This commit is contained in:
mkm 2023-11-13 17:36:31 +08:00
parent 358b504718
commit 576e11a52c
2 changed files with 3 additions and 2 deletions

View File

@ -57,6 +57,7 @@ class CustomContactsLists extends BaseAdminDataLists implements ListsSearchInter
return CustomContacts::where($this->searchWhere)
->field(['id', 'custom_id', 'name', 'position', 'phone', 'telephone', 'email', 'notes', 'annex', 'status'])
->limit($this->limitOffset, $this->limitLength)
->with(['customName'])
->order(['id' => 'desc'])
->select()
->toArray();

View File

@ -37,9 +37,9 @@ class CustomContacts extends BaseModel
* @author likeadmin
* @date 2023/11/11 22:56
*/
public function 关联客户()
public function customName()
{
return $this->hasOne(\app\common\model\custom\Custom::class, 'id', 'custom_id');
return $this->hasOne(\app\common\model\custom\Custom::class, 'id', 'custom_id')->bind(['custom_name'=>'name']);
}
}