request->params([ ["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",""] ]); return success((new SalesService())->getPage($data)); } /** * 销售管理详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new SalesService())->getInfo($id)); } /** * 添加销售管理 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["student_phone",""], ["student_name",""], ["sex",""], ["age",""], ["school_name",""], ["grade",""], ["class_name",""], ["source_channel",""], ["customer_source",""], ["add_staff_id",0], ["get_staff_id",0], ["contact_name",""], ["province_id",0], ["city_id",0], ["district_id",0], ["community_name",""], ["customer_tags",[]], ]); if(!empty($data['customer_tags'])){ $data['customer_tags'] = implode(',',$data['customer_tags']); } $this->validate($data, 'addon\zhjw\app\validate\sales\Sales.add'); $id = (new SalesService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 销售管理编辑 * @param $id 销售管理id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["student_phone",""], ["student_name",""], ["sex",""], ["age",""], ["school_name",""], ["grade",""], ["class_name",""], ["source_channel",""], ["customer_source",""], ["add_staff_id",0], ["get_staff_id",0], ["contact_name",""], ["province_id",0], ["city_id",0], ["district_id",0], ["community_name",""], ["customer_tags",[]], ]); if(!empty($data['customer_tags'])){ $data['customer_tags'] = implode(',',$data['customer_tags']); } $this->validate($data, 'addon\zhjw\app\validate\sales\Sales.edit'); (new SalesService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 销售管理删除 * @param $id 销售管理id * @return \think\Response */ public function del(int $id){ (new SalesService())->del($id); return success('DELETE_SUCCESS'); } public function getStaffAll(){ return success(( new SalesService())->getStaffAll()); } public function getSysAreaAll(){ return success(( new SalesService())->getSysAreaAll()); } }