add-srv-company

This commit is contained in:
lccsw
2021-11-19 10:33:40 +08:00
parent 5d7bee2db5
commit a1fa513691
5 changed files with 38 additions and 10 deletions
+2
View File
@@ -255,6 +255,7 @@ class Store extends HD_Controller
$biz['lng'] = $this->input->post('lng', true);
$biz['type'] = intval($this->input->post('type', true));
$biz['company_id'] = intval($this->input->post('company_id', true));
$biz['srv_company_id'] = intval($this->input->post('srv_company_id', true));
$auto_brands = $this->input->post('auto_brands');
if ($auto_brands) {
@@ -321,6 +322,7 @@ class Store extends HD_Controller
$biz['lng'] = $this->input->post('lng', true);
$biz['type'] = intval($this->input->post('type', true));
$biz['company_id'] = intval($this->input->post('company_id', true));
$biz['srv_company_id'] = intval($this->input->post('srv_company_id', true));
//上传头像
$biz['headimg'] = $this->input->post('headimg');
+10 -1
View File
@@ -274,7 +274,7 @@
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">公司:</label>
<label class="am-para-label">销售公司:</label>
<div class="am-para-input wp20">
<select name="company_id" v-model="info.company_id">
<option value="0">选择公司</option>
@@ -282,6 +282,15 @@
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">服务费公司:</label>
<div class="am-para-input wp20">
<select name="srv_company_id" v-model="info.srv_company_id">
<option value="0">选择公司</option>
<option v-for="(v,i) in companyAry" :value="i">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">授权品牌:</label>
<div class="am-para-input">
+10 -2
View File
@@ -99,7 +99,11 @@ class Protocol extends CI_Controller{
$money_json = json_decode($row['money_json'],true);
//获取门店信息
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
if($biz['srv_company_id']){
$row['company'] = $this->sys_company_model->get(['id'=>$biz['srv_company_id']]);
}else{
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
}
$is_insure = false;
if($row['srv_ids']){
$money_json = json_decode($row['money_json'],true);
@@ -327,7 +331,11 @@ class Protocol extends CI_Controller{
$money_json = json_decode($row['money_json'],true);
//获取门店信息
$biz = $this->biz_model->get(['id'=>$row['biz_id']]);
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
if($biz['srv_company_id']){
$row['company'] = $this->sys_company_model->get(['id'=>$biz['srv_company_id']]);
}else{
$row['company'] = $this->sys_company_model->get(["title like '%服务%'"=>null,'status'=>1]);
}
if($row['srv_ids']){
$service_rows = $this->services_model->select(["id in ({$row['srv_ids']})"=>null],'','','','title');
$services = implode(',',array_column($service_rows,'title'));
+15 -7
View File
@@ -97,13 +97,17 @@ class Orders_entity{
if($need_pay_money > 0 && !$deposit_count){
$this->ci->signs_model->update(['status'=>1],['o_id'=>$this->order_row['id']]);
$srv_money = $this->order_srv_money($oid);
//获取门店信息
$biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id,srv_company_id');
if($srv_money < $this->order_row['deposit']){ //服务费小于定金 给销售公司
//获取门店信息
$biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id');
$company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']],'wx_mchid');
$mch_id = $company['wx_mchid'];
}else{
$mch_id = self::SRV_MCH_ID;
if($biz['srv_company_id']){
$company = $this->ci->sys_company_model->get(['id'=>$biz['srv_company_id']],'wx_mchid');
$company['wx_mchid'] && $mch_id = $company['wx_mchid'];
}
}
$p_row = $this->ci->app_liche_orders_model->get(['o_id'=>$this->order_row['id'],'uid'=>$userinfo['id'],'pid'=>0,'status>='=>0]);
if(!$p_row){
@@ -373,8 +377,9 @@ class Orders_entity{
$jsondata['cover'] = $color['jsondata']['img'];
}
//获取门店信息
$biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id');
$biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id,srv_company_id');
$company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']]);
$srv_company = $this->ci->sys_company_model->get(['id'=>$biz['srv_company_id']]);
$srv_money = $this->order_srv_money($oid); //服务费
$money_json = json_decode($this->order_row['money_json'],true);
@@ -408,7 +413,7 @@ class Orders_entity{
'o_id' => $this->order_row['id'],
'uid' => $userinfo['id'],
'sid' => $sid,
'mch_id' => self::SRV_MCH_ID,
'mch_id' => $srv_company ? $srv_company['wx_mchid'] : self::SRV_MCH_ID,
'pid' => $p_row['id'],
'brand_id' => $this->order_row['brand_id'],
's_id' => $this->order_row['s_id'],
@@ -475,13 +480,17 @@ class Orders_entity{
$sub_row = $this->ci->app_liche_orders_model->get(['o_id'=>$this->order_row['id'],'uid'=>$userinfo['id'],'type'=>4,'status>='=>0]);
if($pid && !$sub_row){
$srv_money = $this->order_srv_money($oid);
//获取门店信息
$biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id,srv_company_id');
if($srv_money < $this->order_row['deposit']){ //服务费小于定金 给销售公司
//获取门店信息
$biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id');
$company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']],'wx_mchid');
$mch_id = $company['wx_mchid'];
}else{
$mch_id = self::SRV_MCH_ID;
if($biz['srv_company_id']){
$company = $this->ci->sys_company_model->get(['id'=>$biz['srv_company_id']],'wx_mchid');
$company['wx_mchid'] && $mch_id = $company['wx_mchid'];
}
}
$sid = create_order_no(350200,'liche',1,4);
$sub_data = [
@@ -514,7 +523,6 @@ class Orders_entity{
2 => '需要提醒客户去狸车小程序确认车辆并签名',
3 => '需要上传客户身份证/营业执照',
4 => '整理上牌资料、国补资料发给客服',
//5 => '客户提完车,需要点击“确认交付”'
5 => '要交接车时,需要点击“确认交付”后让客户去狸车小程序签交接表完成交接'
];
return $config[$status] ? $config[$status] : '';
+1
View File
@@ -30,6 +30,7 @@ create table lc_biz (
alter table lc_biz add column type tinyint(1) not null default 0 comment '类型:1-合伙店,2-加盟店,3-代理店' after floor;
alter table lc_biz add column company_id int not null default 0 comment '公司ID' after type;
alter table lc_biz add column jsondata json null comment '其他数据' after company_id;
alter table lc_biz add srv_company_id int(11) not null default 0 comment '收服务费公司ID' after company_id;
-- ----------------------------
-- Title:品牌表