作者 王小刚

数据库

@@ -93,7 +93,7 @@ class OrderSalesmanController extends WeChatBaseController @@ -93,7 +93,7 @@ class OrderSalesmanController extends WeChatBaseController
93 public function getOrderSalesman(){ 93 public function getOrderSalesman(){
94 $param = $this->request->param(); 94 $param = $this->request->param();
95 if(!empty($param['school'])){ 95 if(!empty($param['school'])){
96 - $where['school'] = ['eq',$param['school']]; 96 + $where['school'] = ['like',"%$param[school]%"];
97 } 97 }
98 if(!empty($param['grade'])){ 98 if(!empty($param['grade'])){
99 $param['grade'] = explode(' - ',$param['grade']); 99 $param['grade'] = explode(' - ',$param['grade']);
@@ -290,4 +290,37 @@ class OrderSalesmanController extends WeChatBaseController @@ -290,4 +290,37 @@ class OrderSalesmanController extends WeChatBaseController
290 return false; 290 return false;
291 } 291 }
292 } 292 }
  293 +
  294 + public function updatePost(){
  295 + $param = $this->request->param();
  296 + $indent_id = $this->request->param('indent_id',0,'intval');
  297 + if(empty($indent_id)){
  298 + $this->error('缺少必要参数123');
  299 + }
  300 + $indentModel = new IndentModel();
  301 + $data = $indentModel->findData(['id'=>$indent_id]);
  302 + if($data['is_courier'] == 1){
  303 + if(empty($param['name']) || empty($param['region']) || empty($param['school']) || empty($param['grade_class']) || empty($param['phone'])){
  304 + $this->error('缺少必要参数');
  305 + }
  306 + $grade_class = explode('-',$param['grade_class']);
  307 + $arr['name'] = $param['name'];
  308 + $arr['phone'] = $param['phone'];
  309 + $arr['region'] = $param['region'];
  310 + $arr['school'] = preg_replace('# #','',$param['school']);
  311 + $arr['grade'] = $grade_class[0];
  312 + $arr['class'] = $grade_class[1];
  313 + $result = $indentModel ->updateData(['id'=>$indent_id],$arr);
  314 + }else if($data['is_courier'] == 2){
  315 + if(empty($param['name']) || empty($param['phone']) || empty($param['region']) || empty($param['region_detail'])){
  316 + $this->error('缺少必要参数123');
  317 + }
  318 + $arr['name'] = $param['name'];
  319 + $arr['phone'] = $param['phone'];
  320 + $arr['region'] = $param['region'];
  321 + $arr['region_detail'] = $param['region_detail'];
  322 + $result = $indentModel ->updateData(['id'=>$indent_id],$arr);
  323 + }
  324 + $this->success('SUCCESS');
  325 + }
293 } 326 }
@@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
204 */ 204 */
205 public function checkWeChatUserLogin() 205 public function checkWeChatUserLogin()
206 { 206 {
207 -// $user = Db::name('user')->where('id',3)->find(); 207 +// $user = Db::name('user')->where('id',6)->find();
208 // cmf_update_current_user($user); 208 // cmf_update_current_user($user);
209 // session('user',null); 209 // session('user',null);
210 $userId = cmf_get_current_user_id(); 210 $userId = cmf_get_current_user_id();