diff --git a/app/api/controller/LogisticsController.php b/app/api/controller/LogisticsController.php index 131bee4f..b08bf302 100755 --- a/app/api/controller/LogisticsController.php +++ b/app/api/controller/LogisticsController.php @@ -165,9 +165,9 @@ class LogisticsController extends BaseApiController $result = LogisticsLogic::getCoutier($param); //返回数据 if($result){ - return $this->success('有配送员'); + return $this->success('有配送员', $result); }else{ - return $this->fail('无配送员'); + return $this->success('无配送员', []); } } diff --git a/app/api/logic/LogisticsLogic.php b/app/api/logic/LogisticsLogic.php index 9df456ab..ec0d0337 100644 --- a/app/api/logic/LogisticsLogic.php +++ b/app/api/logic/LogisticsLogic.php @@ -186,10 +186,10 @@ class LogisticsLogic extends BaseLogic //查找商家信息 $shop = Merchant::field('mer_id,mer_name,real_name,mer_phone,mer_address,long,lat')->where('mer_id',$order['mer_id'])->find(); //获取队长用户信息 - $captain = Courier::field('id,company_id,nickname,mobile')->where("CONCAT_WS(',',province,city,area,street,village,brigade) = '". $order['user_address_code']."'")->where('is_captain',1)->find(); + $captain = Courier::field('id,company_id,nickname,mobile')->where("CONCAT_WS(',',province,city,area,street,village,brigade) = '". $order['user_address_code']."'")->whereIn('group_id',[2, 18])->find(); if(!$captain) return ['code'=>0, 'msg'=>'无法确定所在小队']; //获取配送员信息 - $courier = Company::field('company_name,user_id,master_name,master_phone')->where('id',$captain['company_id'])->find(); + $courier = Courier::field('nickname as company_name,id as user_id,nickname as master_name,mobile as master_phone')->where('group_id',20)->find(); //判断配送员是否存在 if(!$courier) return ['code'=>0, 'msg'=>'配送员未匹配']; //获取下单用户信息 @@ -398,14 +398,18 @@ class LogisticsLogic extends BaseLogic } } - public static function getCoutier($code):bool { + public static function getCoutier($code) { //获取队长用户信息 - $captain = Courier::field('id,company_id,nickname,mobile')->where("CONCAT_WS(',',province,city,area,street,village,brigade) = '". $code ."'")->where('is_captain',1)->find(); + $captain = Courier::field('id,company_id,nickname,mobile')->where("CONCAT_WS(',',province,city,area,street,village,brigade) = '". $code."'")->whereIn('group_id',[2, 18])->find(); + +// $captain = Courier::field('id,company_id,nickname,mobile')->where("CONCAT_WS(',',province,city,area,street,village,brigade) = '". $code ."'")->where('is_captain',1)->find(); if(!$captain) return false; //获取配送员信息 - $courier = Company::field('company_name,user_id,master_name,master_phone')->where('id',$captain['company_id'])->find(); + $courier = Courier::field('id as user_id,nickname as master_name,mobile as master_phone')->where('group_id',20)->find(); + +// $courier = Company::field('company_name,user_id,master_name,master_phone')->where('id',$captain['company_id'])->find(); if(!$courier) return false; - return true; + return $courier; } } \ No newline at end of file diff --git a/public/nginx.htaccess b/public/nginx.htaccess index a24cf3bb..a1784fea 100755 --- a/public/nginx.htaccess +++ b/public/nginx.htaccess @@ -1,5 +1,5 @@ -location / { - if (!-f $request_filename) { - rewrite ^(.*)$ /index.php?s=/$1 last; - } +if (!-e $request_filename) +{ + rewrite ^/(.*)$ /index.php?s=$1 last; + break; } \ No newline at end of file