diff --git a/app/adminapi/lists/custom/CustomFollowLists.php b/app/adminapi/lists/custom/CustomFollowLists.php index 037908cad..a6ed4267a 100644 --- a/app/adminapi/lists/custom/CustomFollowLists.php +++ b/app/adminapi/lists/custom/CustomFollowLists.php @@ -40,7 +40,7 @@ class CustomFollowLists extends BaseAdminDataLists implements ListsSearchInterfa public function setSearch(): array { return [ - '%like%' => ['name', 'contacts', 'executor'], + '%like%' => ['name', 'executor'], '=' => ['custom_id','types'] ]; } @@ -63,15 +63,16 @@ class CustomFollowLists extends BaseAdminDataLists implements ListsSearchInterfa $custom_ids = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id'); $where[] = ['custom_id','in',$custom_ids]; } - return CustomFollow::field('id,custom_id,name,contacts,date,types,executor,description,coordinate,next_follow_date,add_user,update_user,create_time,update_time') + return CustomFollow::field('id,custom_id,name,date,types,executor,description,coordinate,next_follow_date,add_user,update_user,create_time,update_time') ->where($this->searchWhere)->where($where) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($item){ $item['types_text'] = $item->types_text; - $custom = Custom::field('name')->where('id',$item['custom_id'])->findOrEmpty(); + $custom = Custom::field('name,master_name')->where('id',$item['custom_id'])->findOrEmpty(); $admin = Admin::where('id','in',[$item['add_user'],$item['update_user']])->column('name','id'); $item['custom_name'] = $custom['name']; + $item['custom_master_name'] = $custom['master_name']; $item['add_user'] = $admin[$item['add_user']]; $item['update_user'] = $admin[$item['update_user']]; return $item; diff --git a/app/adminapi/logic/custom/CustomFollowLogic.php b/app/adminapi/logic/custom/CustomFollowLogic.php index 79f5a30c5..d1d70f727 100644 --- a/app/adminapi/logic/custom/CustomFollowLogic.php +++ b/app/adminapi/logic/custom/CustomFollowLogic.php @@ -44,7 +44,6 @@ class CustomFollowLogic extends BaseLogic CustomFollow::create([ 'custom_id' => $params['custom_id'], 'name' => $params['name'], - 'contacts' => $params['contacts'] ?? '', 'date' => strtotime($params['date']), 'types' => $params['types'], 'description' => $params['description'] ?? '', @@ -79,7 +78,6 @@ class CustomFollowLogic extends BaseLogic CustomFollow::where('id', $params['id'])->update([ 'custom_id' => $params['custom_id'], 'name' => $params['name'], - 'contacts' => $params['contacts'] ?? '', 'date' => strtotime($params['date']), 'types' => $params['types'], 'description' => $params['description'] ?? '', @@ -122,9 +120,10 @@ class CustomFollowLogic extends BaseLogic */ public static function detail($params): array { - $data = CustomFollow::field('id,custom_id,name,contacts,date,types,description,annex,coordinate,next_follow_date,executor')->findOrEmpty($params['id']); - $custom = Custom::field('name')->where('id',$data['custom_id'])->findOrEmpty(); + $data = CustomFollow::field('id,custom_id,name,date,types,description,annex,coordinate,next_follow_date,executor')->findOrEmpty($params['id']); + $custom = Custom::field('name,master_name')->where('id',$data['custom_id'])->findOrEmpty(); $data['custom_name'] = $custom['name']; + $data['custom_master_name'] = $custom['master_name']; return $data->toArray(); } } \ No newline at end of file