edit-api-biz_company
This commit is contained in:
@@ -105,23 +105,14 @@ class Orders_v2_entity{
|
||||
public function get_biz_mchid($biz_id,$car_brand_id=0,$if_local_bill=false){
|
||||
$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])){ //品牌店
|
||||
$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('id','',$where,'','','',$filed);
|
||||
$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'=>$car_brand_id],'type,city_id,company_id,srv_company_id');
|
||||
if($brand_biz){
|
||||
$where = [
|
||||
"id in ({$brand_biz['company_id']},{$brand_biz['srv_company_id']})" => null
|
||||
];
|
||||
$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];
|
||||
}
|
||||
$company = $companys[$brand_biz['company_id']][0];
|
||||
$srv_company = $companys[$brand_biz['srv_company_id']][0];
|
||||
}
|
||||
$local_city = false;
|
||||
if(in_array($biz['city_id'],$this->local_bill_citys) && $if_local_bill){ //是否开具本地发票且在指定城市用本地城市
|
||||
@@ -139,10 +130,10 @@ class Orders_v2_entity{
|
||||
if(!$srv_company){ //获取固定id服务公司
|
||||
$srv_company = $this->ci->sys_company_model->get(['id'=>4],$filed);
|
||||
}
|
||||
//特殊需求临死写死
|
||||
//if($biz['id']!=20 && $biz['city_id']==350200){ //厦门狸车销售公司
|
||||
// $company = $this->ci->sys_company_model->get(['id'=>1],$filed);
|
||||
//}
|
||||
//跑零 用泉州销售公司
|
||||
if($car_brand_id==5){
|
||||
$company = $this->ci->sys_company_model->get(['id'=>2],$filed);
|
||||
}
|
||||
$data = [
|
||||
'company' => $company,
|
||||
'srv_company' => $srv_company
|
||||
|
||||
Reference in New Issue
Block a user