更新待办任务
This commit is contained in:
parent
10750f1628
commit
282942bbc5
|
@ -86,19 +86,31 @@ class Common extends ApiController
|
|||
public function get_task_list()
|
||||
{
|
||||
$user_id = JWT_UID;
|
||||
|
||||
$map1 = [];
|
||||
$map1[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',check_admin_ids)")];
|
||||
$approve = Db::name('Approve')->where($map1)->order('id desc')->limit(2)->select();
|
||||
|
||||
$map1 = [];
|
||||
$map1[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',check_admin_ids)")];
|
||||
$expense = Db::name('Expense')->where($map1)->order('id desc')->limit(2)->select();
|
||||
|
||||
$map1 = [];
|
||||
$map1[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',check_admin_ids)")];
|
||||
$invoice = Db::name('Invoice')->where($map1)->order('id desc')->limit(2)->select();
|
||||
$this->apiSuccess('获取成功', compact('approve', 'expense', 'invoice'));
|
||||
$map1[] = ['', 'exp', Db::raw("FIND_IN_SET('{$user_id}',f.check_admin_ids)")];
|
||||
$param['status'] = 1;
|
||||
$list = Db::name('Approve')
|
||||
->field('f.*,a.name,d.title as department_name,t.title as flow_type')
|
||||
->alias('f')
|
||||
->join('Admin a', 'a.id = f.admin_id', 'left')
|
||||
->join('Department d', 'd.id = f.department_id', 'left')
|
||||
->join('FlowType t', 't.id = f.type', 'left')
|
||||
->where($map1)
|
||||
->order('f.id desc')
|
||||
->group('f.id')
|
||||
->paginate(['list_rows' => 2, 'query' => $param])
|
||||
->each(function($item, $key){
|
||||
$item['create_time'] = date('Y-m-d H:i:s', $item['create_time']);
|
||||
$item['start_time'] = date('Y-m-d H:i:s', $item['start_time']);
|
||||
$item['end_time'] = date('Y-m-d H:i:s', $item['end_time']);
|
||||
$item['check_user'] = '-';
|
||||
if($item['check_status']<2 && !empty($item['check_admin_ids'])){
|
||||
$check_user = Db::name('Admin')->where('id','in',$item['check_admin_ids'])->column('name');
|
||||
$item['check_user'] = implode(',',$check_user);
|
||||
}
|
||||
return $item;
|
||||
});
|
||||
$list = $list->toArray();
|
||||
$this->apiSuccess('获取成功', $list['data']);
|
||||
}
|
||||
|
||||
private function isAuthProject($uid)
|
||||
|
|
Loading…
Reference in New Issue