|
@@ -15,14 +15,40 @@ class Usercompany extends Apic
|
|
|
protected $table = 'user_company';
|
|
|
|
|
|
public function index(){
|
|
|
+ $search = [];
|
|
|
+ $user_nickname = input('user_nickname','');
|
|
|
+ $projectname = input('projectname','');
|
|
|
+ $weituo = input('weituo','');
|
|
|
+ $header = input('header','');
|
|
|
+ if(!empty($user_nickname)){
|
|
|
+ $search['user.nickname'] = ['LIKE','%'.$user_nickname.'%'];
|
|
|
+ }
|
|
|
+ if(!empty($projectname)){
|
|
|
+ $search['a.projectname'] = ['LIKE','%'.$projectname.'%'];
|
|
|
+ }
|
|
|
+ if(!empty($weituo)){
|
|
|
+ $search['a.weituo'] = ['LIKE','%'.$weituo.'%'];
|
|
|
+ }
|
|
|
+ if(!empty($header)){
|
|
|
+ $search['a.header'] = ['LIKE','%'.$header.'%'];
|
|
|
+ }
|
|
|
+
|
|
|
$list = Db::name($this->table)->alias('a')
|
|
|
->field('a.id,a.projectname,a.starttime,a.endtime,a.weituo,a.fuwujigou,a.header,a.header_mobile,user.nickname as user_nickname,user.mobile as user_mobile')
|
|
|
->join('user','a.user_id = user.id','LEFT')
|
|
|
->where('a.company_id',$this->auth->company_id)
|
|
|
->where('a.deletetime',NULL)
|
|
|
- ->select();
|
|
|
+ ->where($search)
|
|
|
+ ->paginate();
|
|
|
+ $total = $list->total();
|
|
|
+ $list = $list->items();
|
|
|
+
|
|
|
+ $rs = [
|
|
|
+ 'list' => $list,
|
|
|
+ 'total'=> $total,
|
|
|
+ ];
|
|
|
|
|
|
- $this->success(1,$list);
|
|
|
+ $this->success(1,$rs);
|
|
|
}
|
|
|
|
|
|
//检索未绑定过的正常用户
|