更新供应链名称

This commit is contained in:
mkm 2024-01-15 10:21:43 +08:00
parent de6058aaa5
commit 0bf7ccb8fb
3 changed files with 7 additions and 3 deletions

View File

@ -23,7 +23,7 @@ use app\adminapi\validate\supplier\SupplierContactsValidate;
/**
* SupplierContacts控制器
* 供应商联系人
* Class SupplierContactsController
* @package app\adminapi\controller\supplier
*/

View File

@ -22,7 +22,7 @@ use app\common\lists\ListsSearchInterface;
use think\facade\Db;
/**
* SupplierContacts列表
* 供应商联系人
* Class SupplierContactsLists
* @package app\adminapi\listssupplier
*/
@ -57,7 +57,8 @@ class SupplierContactsLists extends BaseAdminDataLists implements ListsSearchInt
public function lists(): array
{
return SupplierContacts::where($this->searchWhere)
->field('id,name,sex,birthday,contacts_type,responsible,contacts_cate,department,duties,work_phone,remark')
->field('id,supplier_id,name,sex,birthday,contacts_type,responsible,contacts_cate,department,duties,work_phone,remark')
->with(['supplier'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function($data){

View File

@ -65,4 +65,7 @@ class SupplierContacts extends BaseModel
return $dict[$data['id_type']];
}
public function supplier(){
return $this->hasOne(Supplier::class,'id','supplier_id')->bind(['supplier_name','supplier_code']);
}
}