Commit 633b2622 by 汪伟伟

未审核模块 操作之后就不显示

parent 3961f232
......@@ -226,6 +226,7 @@ class AlreadyDoneTaskController extends AdminController
}
}
TasksCollect::query()->where('receive_id', $this->id)->update(['images' => $images]);//更新
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['time'=>date('Y-m-d H:i:s')]);//更新完成时间
});
$form->disableDeleteButton();
......
......@@ -141,6 +141,7 @@ class NoDoneTaskController extends AdminController
$receive = \App\Models\TasksReceive::query()->find($id);
if ($receive){
$receive->status =1;
$receive->time =date('Y-m-d H:i:s');
TasksCollect::query()->where('receive_id',$id)->update(['is_find'=>0,'remark'=>$remark]);
$receive->save();
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
......@@ -244,7 +245,7 @@ class NoDoneTaskController extends AdminController
if ($this->status == 0) {
// dd($this->id);
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['status' => 1]);//状态更新成已完成
\App\Models\TasksReceive::query()->where('id', $this->id)->update(['status' => 1,'time'=>date('Y-m-d H:i:s')]);//状态更新成已完成
TasksCollect::query()->where('receive_id', $this->id)->update(['is_find' => 1]);//可以找到
TasksApprove::query()->updateOrCreate([//审核表里新增一条记录
'task_id' => $this->task_id,
......
......@@ -45,7 +45,7 @@ class TaskController extends AdminController
$grid->addTableClass(['table-text-center']);//设置表格文字居中
// $grid->title('dasd');
$grid->model()->whereNotIn('id', $exists);
$grid->model()->whereNotIn('id', $exists)->orderBy('created_at','desc');
// dd(Admin::user()->is_admin);
// dd(trans('admin.view'));//查看
......
......@@ -42,9 +42,15 @@ class TasksApproveController extends AdminController
if (!empty($userId)) {
$query->where('user_id', $userId);
}
$query->where('status', 1)->orderBy('created_at', 'desc');
$query->where('status', 1);
})
->with(['receives.collects', 'receives.user', 'receives.approve'])->paginate($pageSize, '*', 'page', $page)->toArray();
->with(['receives'=>function($qq){
$qq->orderBy('time','desc');
}
,'receives.collects', 'receives.user', 'receives.approve'])
->orderBy('created_at','desc')
->paginate($pageSize, '*', 'page', $page)
->toArray();
foreach ($data['data'] as $key => &$item) {
if (count($item['receives']) > 1) {
......
......@@ -31,6 +31,7 @@ class TasksReceive extends Model
'order_id',
'area',
'status',
'time',
'created_at',
'updated_at',
];
......
......@@ -20,6 +20,7 @@ class CreateTasksApprovesTable extends Migration
$table->bigInteger('receive_id')->comment('用户领取的任务id');
$table->tinyInteger('status')->default('0')->comment('0:未审核,1:审核不通过,2:审核通过,3:已结算');
$table->string('msg')->nullable()->comment('未通过原因');
$table->dateTime('time')->nullable()->comment('审核时间');
$table->timestamps();
});
}
......
......@@ -20,6 +20,7 @@ class CreateTasksReceivesTable extends Migration
$table->bigInteger('order_id')->default('0')->comment('所属结算单id');
$table->string('area')->default('')->comment('地区');
$table->tinyInteger('status')->default('0')->comment('任务状态:(0:已领取但未完成的任务;1:已经完成但未审核的任务;2:审核不通过的任务;3:审核通过但未结算的任务;4:已经结算的任务)');
$table->dateTime('time')->nullable()->comment('完成时间');
$table->timestamps();
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment