diff --git a/api/controllers/plan/Liche.php b/api/controllers/plan/Liche.php index b7ccd32d..40d5cf2f 100644 --- a/api/controllers/plan/Liche.php +++ b/api/controllers/plan/Liche.php @@ -19,7 +19,7 @@ class Liche extends HD_Controller $row = $this->receiver_order_contracts_model->get(['o_id>='=>Orders_v2_entity::V2_START_ID,'flag'=>0,'file !='=>'','status'=>1]); $receiver = $this->receiver_orders_v2_model->get(['id' => $row['o_id']]); if(file_exists(FCPATH.$row['file']) && $receiver){ - $companys = $this->orders_v2_entity->get_biz_mchid($receiver['biz_id']); + $companys = $this->orders_v2_entity->get_biz_mchid($receiver['biz_id'],$receiver['brand_id']); $url = http_host_com(); $width = 130; $s_img = build_qiniu_image_url($companys['company']['img_seal']); @@ -70,4 +70,4 @@ class Liche extends HD_Controller } } } -} \ No newline at end of file +} diff --git a/api/controllers/wxapp/licheb/CusorderV2.php b/api/controllers/wxapp/licheb/CusorderV2.php index c1ed090e..6eb67870 100644 --- a/api/controllers/wxapp/licheb/CusorderV2.php +++ b/api/controllers/wxapp/licheb/CusorderV2.php @@ -211,7 +211,7 @@ class CusorderV2 extends Wxapp{ $this->customers_model->update(array('order_time' => date('Y-m-d H:i:s')),['id'=>$cus_id]); $this->customers_entity->add_log($cus_id, $this->session['uid'], $this->session['uname'], "新增订单"); - return ['id'=>$o_id,'admin_img' => $orders_entity::API_ADMIN_IMG,'pay_img'=>$orders_entity::API_CREATE_PAY_IMG]; + return ['id'=>$o_id,'pay_img'=>$orders_entity::API_CREATE_PAY_IMG]; }else{ throw new Exception('创建失败', ERR_PARAMS_ERROR); } @@ -289,7 +289,7 @@ class CusorderV2 extends Wxapp{ $userinfo = $this->app_liche_users_model->get(['mobile'=>$data['mobile']],'id'); $orders_entity->c_intention($o_id,$userinfo['id'],$inten_money); } - return ['id'=>$o_id,'admin_img' => $orders_entity::API_ADMIN_IMG,'pay_img'=>$orders_entity::API_CREATE_PAY_IMG]; + return ['id'=>$o_id,'pay_img'=>$orders_entity::API_CREATE_PAY_IMG]; } //修改订单信息 @@ -467,7 +467,6 @@ class CusorderV2 extends Wxapp{ 'id' => $id, 'name' => $row['name'], 'mobile' => mobile_asterisk($row['mobile']), - 'admin_img' => $orders_entity::API_ADMIN_IMG, 'payway' => $row['brand_id'] ? $row['payway'] : '', 'car_data' => $car_data, 'pay_status' => $pay_status, @@ -486,7 +485,6 @@ class CusorderV2 extends Wxapp{ 'srv_arr' => $row['srv_ids'] ? json_decode($row['srv_ids'],true) : [], 'cus_id' => $row['customer_id'], 'status' => $row['status'], - 'my_img' => $orders_entity::API_CREATE_PAY_IMG, 'if_fine' => $row['if_fine'] ? 1 : 0, 'main_type' => intval($row['main_type']), 'fines' => $row['fines'] ? json_decode($row['fines'],true) : [], diff --git a/api/controllers/wxapp/licheb/Protocol.php b/api/controllers/wxapp/licheb/Protocol.php index 268e9c2d..142b8f01 100644 --- a/api/controllers/wxapp/licheb/Protocol.php +++ b/api/controllers/wxapp/licheb/Protocol.php @@ -393,7 +393,7 @@ class Protocol extends CI_Controller{ $imgs = $this->pdf->pdf2img($pdf_url); if($imgs){ if(!$row['flag']){ - $companys = $this->orders_v2_entity->get_biz_mchid($order['biz_id']); + $companys = $this->orders_v2_entity->get_biz_mchid($order['biz_id'],$order['brand_id']); $img_seal = build_qiniu_image_url($companys['company']['img_seal']); $width = 325; if($row['type']==1){ diff --git a/common/libraries/receiver/Orders_v2_entity.php b/common/libraries/receiver/Orders_v2_entity.php index 7040dc03..a2436105 100644 --- a/common/libraries/receiver/Orders_v2_entity.php +++ b/common/libraries/receiver/Orders_v2_entity.php @@ -10,7 +10,7 @@ class Orders_v2_entity{ const SRV_MCH_ID = '1612636924'; //收取服务费商户号 厦门狸车服务 const PRICE_FINANCE = 1000; //金融服务费写死 const PRICE_FINANCE_NZ = 2000; //哪吒金融服务费 - const API_ADMIN_IMG = 'https://img.liche.cn/liche/2021/08/7725fc9ab0dc0ba1/f3c84cf3b805bac4.png'; //api 客服二维码 + //const API_ADMIN_IMG = 'https://img.liche.cn/liche/2021/08/7725fc9ab0dc0ba1/f3c84cf3b805bac4.png'; //api 客服二维码 const API_PAY_IMG = 'https://img.liche.cn/liche/1634022931.png'; //api 意向金跳转支付二维码 const API_CREATE_PAY_IMG = 'https://img.liche.cn/liche/2021/11/65b34b962f5f06b3/62e7d28d77bfe404.png'; //api 狸车我的页面 const V2_START_ID = 10000; //升级后订单开始 @@ -73,7 +73,7 @@ class Orders_v2_entity{ $sub_row = $this->ci->app_liche_orders_model->get(['o_id'=>$this->order_row['id'],'type'=>4,'status>='=>0]); if($pid && !$sub_row){ //获取微信商户号 - $companys = $this->get_biz_mchid($this->order_row['biz_id']); + $companys = $this->get_biz_mchid($this->order_row['biz_id'],$this->order_row['brand_id']); $sid = create_order_no(350200,'liche',1,4); $sub_data = [ 'o_id' => $this->order_row['id'], @@ -99,9 +99,10 @@ class Orders_v2_entity{ /** * 获取商家微信商户号 * @param $biz_id int 商家id + * @param $car_brand_id int 品牌id * @return array ['company'=>[],'srv_company'=>[]] */ - public function get_biz_mchid($biz_id){ + public function get_biz_mchid($biz_id,$car_brand_id=0){ $biz = $this->ci->biz_model->get(['id'=>$biz_id],'type,city_id,company_id,srv_company_id,car_brand_id'); $filed = 'id,wx_mchid,title,short,credit_code,wx_mchid,img_seal'; if(in_array($biz['type'],[1])){ //品牌店 @@ -112,14 +113,14 @@ class Orders_v2_entity{ $company = $companys[$biz['company_id']][0]; $srv_company = $companys[$biz['srv_company_id']][0]; }else{ //其它店铺 - $brand_biz = $this->ci->biz_model->get(['city_id'=>$biz['city_id'],'type'=>1,'status'=>1,'car_brand_id'=>$biz['car_brand_id']],'type,city_id,company_id,srv_company_id'); + $brand_biz = $this->ci->biz_model->get(['city_id'=>$biz['city_id'],'type'=>1,'status'=>1,'car_brand_id'=>$car_brand_id],'type,city_id,company_id,srv_company_id'); if($brand_biz){ $where = [ - "id in ({$biz['company_id']},{$biz['srv_company_id']})" => null + "id in ({$brand_biz['company_id']},{$brand_biz['srv_company_id']})" => null ]; - $companys = $this->ci->sys_company_model->map('wx_mchid','',$where,'','','',$filed); - $company = $companys[$biz['company_id']][0]; - $srv_company = $companys[$biz['srv_company_id']][0]; + $companys = $this->ci->sys_company_model->map('id','',$where,'','','',$filed); + $company = $companys[$brand_biz['company_id']][0]; + $srv_company = $companys[$brand_biz['srv_company_id']][0]; } } if(!$company){ //获取城市销售公司 @@ -259,7 +260,7 @@ class Orders_v2_entity{ $sub_row = $this->ci->app_liche_orders_model->get(['o_id'=>$this->order_row['id'],'type'=>1,'status>='=>0]); if($pid && !$sub_row){ //获取微信商户号 - $companys = $this->get_biz_mchid($this->order_row['biz_id']); + $companys = $this->get_biz_mchid($this->order_row['biz_id'],$this->order_row['brand_id']); $sid = create_order_no(350200,'liche',1,1); $sub_data = [ 'o_id' => $this->order_row['id'], @@ -299,7 +300,7 @@ class Orders_v2_entity{ } //获取微信商户号 - $companys = $this->get_biz_mchid($this->order_row['biz_id']); + $companys = $this->get_biz_mchid($this->order_row['biz_id'],$this->order_row['brand_id']); $srv_money = $this->order_srv_money($oid); //服务费 $money_json = json_decode($this->order_row['money_json'],true); @@ -594,7 +595,7 @@ class Orders_v2_entity{ } $data['now_day'] = date('Y-m-d'); - $data['companys'] = $this->get_biz_mchid($row['biz_id']); + $data['companys'] = $this->get_biz_mchid($row['biz_id'],$row['brand_id']); if($type==1){ $items = $this->ci->items_model->get(['id'=>$row['item_id']],'vin'); $delivery = $this->ci->deliverys_model->get(['o_id'=>$row['id']],'info,tool,remark'); @@ -638,4 +639,5 @@ class Orders_v2_entity{ } return $data; } + }