更新
This commit is contained in:
parent
541ae15027
commit
b8f62a12c2
@ -67,17 +67,14 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$field = "id,sn,nickname,sex,avatar,account,mobile,channel,create_time,admin_id,company_id,street,street as street_name,is_contract";
|
$field = "id,id contract,sn,nickname,sex,avatar,account,mobile,channel,create_time,admin_id,company_id,street,street as street_name,is_contract";
|
||||||
$lists = User::withSearch($this->setSearch(), $this->params)
|
$lists = User::withSearch($this->setSearch(), $this->params)
|
||||||
->with(['company'])
|
->with(['company'])
|
||||||
->where($where)
|
->where($where)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->field($field)
|
->field($field)
|
||||||
->order('id desc')
|
->order('id desc')
|
||||||
->select()->each(function($item, $key){
|
->select()
|
||||||
$find= Contract::where('type',2)->where('party_b',$item['id'])->field('id,party_a,party_b,check_status')->find();
|
|
||||||
$item['contract'] = $find;
|
|
||||||
})
|
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
foreach ($lists as &$item) {
|
foreach ($lists as &$item) {
|
||||||
|
@ -214,4 +214,13 @@ class User extends BaseModel
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getContractAttr(){
|
||||||
|
$find= Contract::where('type',2)->where('party_b',$this->id)->field('id,party_a,party_b,check_status')->find();
|
||||||
|
if($find){
|
||||||
|
return $find->toArray();
|
||||||
|
}else{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user