|
|
@ -41,7 +41,7 @@ class SalesService extends BaseAdminService |
|
|
$field = 'id,student_phone,student_name,sex,age,school_name,grade,class_name,source_channel,customer_source,add_staff_id,get_staff_id,contact_name,province_id,city_id,district_id,full_address,community_name,customer_tags,create_time,update_time,is_deleted,created_by,created_role,updated_by,updated_role'; |
|
|
$field = 'id,student_phone,student_name,sex,age,school_name,grade,class_name,source_channel,customer_source,add_staff_id,get_staff_id,contact_name,province_id,city_id,district_id,full_address,community_name,customer_tags,create_time,update_time,is_deleted,created_by,created_role,updated_by,updated_role'; |
|
|
$order = 'id desc'; |
|
|
$order = 'id desc'; |
|
|
|
|
|
|
|
|
$search_model = $this->model->withSearch(["student_phone","student_name","sex","age","school_name","grade","class_name","source_channel","customer_source","add_staff_id","get_staff_id","contact_name","province_id","city_id","district_id","community_name","customer_tags","create_time"], $where)->with(['staff','staff','sysArea','sysArea','sysArea'])->field($field)->order($order); |
|
|
$search_model = $this->model->withSearch(["student_phone", "student_name", "sex", "age", "school_name", "grade", "class_name", "source_channel", "customer_source", "add_staff_id", "get_staff_id", "contact_name", "province_id", "city_id", "district_id", "community_name", "customer_tags", "create_time"], $where)->with(['staff', 'staff', 'sysArea', 'sysArea', 'sysArea'])->field($field)->order($order); |
|
|
$list = $this->pageQuery($search_model); |
|
|
$list = $this->pageQuery($search_model); |
|
|
return $list; |
|
|
return $list; |
|
|
} |
|
|
} |
|
|
@ -55,7 +55,20 @@ class SalesService extends BaseAdminService |
|
|
{ |
|
|
{ |
|
|
$field = 'id,student_phone,student_name,sex,age,school_name,grade,class_name,source_channel,customer_source,add_staff_id,get_staff_id,contact_name,province_id,city_id,district_id,full_address,community_name,customer_tags,create_time,update_time,is_deleted,created_by,created_role,updated_by,updated_role'; |
|
|
$field = 'id,student_phone,student_name,sex,age,school_name,grade,class_name,source_channel,customer_source,add_staff_id,get_staff_id,contact_name,province_id,city_id,district_id,full_address,community_name,customer_tags,create_time,update_time,is_deleted,created_by,created_role,updated_by,updated_role'; |
|
|
|
|
|
|
|
|
$info = $this->model->field($field)->where([['id', "=", $id]])->with(['staff','staff','sysArea','sysArea','sysArea'])->findOrEmpty()->toArray(); |
|
|
$info = $this->model->field($field)->where([['id', "=", $id]])->with(['staff', 'staff', 'sysArea', 'sysArea', 'sysArea'])->findOrEmpty()->toArray(); |
|
|
|
|
|
|
|
|
|
|
|
if(empty($info['customer_tags'])){ |
|
|
|
|
|
$info['customer_tags'] = []; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$info['customer_tags'] = explode(',',$info['customer_tags']); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!empty($info['province_id']) && !empty($info['city_id']) && !empty($info['district_id'])){ |
|
|
|
|
|
$info['full_address_id'] = [$info['province_id'],$info['city_id'],$info['district_id']]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$info['full_address_id'] = []; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return $info; |
|
|
return $info; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -96,16 +109,18 @@ class SalesService extends BaseAdminService |
|
|
return $res; |
|
|
return $res; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getStaffAll(){ |
|
|
public function getStaffAll() |
|
|
$staffModel = new Staff(); |
|
|
{ |
|
|
return $staffModel->select()->toArray(); |
|
|
$staffModel = new Staff(); |
|
|
|
|
|
return $staffModel->select()->toArray(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getSysAreaAll(){ |
|
|
public function getSysAreaAll() |
|
|
$sysAreaModel = new SysArea(); |
|
|
{ |
|
|
return $sysAreaModel->select()->toArray(); |
|
|
$sysAreaModel = new SysArea(); |
|
|
|
|
|
return $sysAreaModel->select()->toArray(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|