business add proxy_type about
This commit is contained in:
@@ -120,6 +120,7 @@ class Business extends HD_Controller{
|
||||
'price_coplus' => $v['price_coplus'] > 0 ? $v['price_coplus'] : '0.00',
|
||||
'price_color' => $v['price_color'] > 0 ? $v['price_color'] : '0.00',
|
||||
'profix_car' => $v['profix_car'],
|
||||
'proxy_type' => $v['proxy_type'] == 0 ? '返佣' : '票折',
|
||||
'proxy_profix_car' => $v['proxy_profix_car'],
|
||||
'profix_insure' => $v['profix_insure'],
|
||||
'profix_carno' => $v['profix_carno'],
|
||||
@@ -170,6 +171,7 @@ class Business extends HD_Controller{
|
||||
'price_floor' => $row['price_floor'],
|
||||
'price_color' => $row['price_color'],
|
||||
'price_coplus' => $row['price_coplus'],
|
||||
'proxy_type' => intval($row['proxy_type']),
|
||||
'proxy_profix_car' => $row['proxy_profix_car'],
|
||||
'profix_car' => $row['profix_car'],
|
||||
'profix_carno' => $row['profix_carno'],
|
||||
@@ -198,6 +200,7 @@ class Business extends HD_Controller{
|
||||
'price_floor' => 0.00,
|
||||
'price_color' => 0.00,
|
||||
'price_coplus' => 0.00,
|
||||
'proxy_type' => 0,
|
||||
'proxy_profix_car' => 0.00,
|
||||
'profix_car' => 0.00,
|
||||
'profix_carno' => 0.00,
|
||||
@@ -255,6 +258,7 @@ class Business extends HD_Controller{
|
||||
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
|
||||
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
|
||||
$info['price_color'] && $data['price_color'] = $info['price_color'];
|
||||
$data['proxy_type'] = $info['proxy_type'];
|
||||
$info['proxy_profix_car'] && $data['proxy_profix_car'] = $info['proxy_profix_car'];
|
||||
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
|
||||
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
|
||||
@@ -307,6 +311,7 @@ class Business extends HD_Controller{
|
||||
$info['price_floor'] && $data['price_floor'] = $info['price_floor'];
|
||||
$info['price_coplus'] && $data['price_coplus'] = $info['price_coplus'];
|
||||
$info['price_color'] && $data['price_color'] = $info['price_color'];
|
||||
$data['proxy_type'] = $info['proxy_type'];
|
||||
$info['proxy_profix_car'] && $data['proxy_profix_car'] = $info['proxy_profix_car'];
|
||||
$info['profix_car'] && $data['profix_car'] = $info['profix_car'];
|
||||
$info['profix_carno'] && $data['profix_carno'] = $info['profix_carno'];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</ul>
|
||||
<form id="vue-edit-business" class="am-form am-form-horizontal tab-content" action="/auto/cars/edit" data-auto="true" method="post" style="width: 90%;padding:25px 30px 20px 0;margin: 0 auto;">
|
||||
<div class="tab-pane fade in active" id="swzc">
|
||||
<div class="am-form-group wp50">
|
||||
<div class="am-form-group wp80">
|
||||
<label class="am-para-label">车型:</label>
|
||||
<div class="am-para-input" style="width: 100%;">
|
||||
<select name="brand_id" style="display: inline;width: 100px" v-model="info.brand_id">
|
||||
@@ -23,7 +23,7 @@
|
||||
<option value="">车系</option>
|
||||
<option :value="i" v-for="(v,i) in seryAry">{{v}}</option>
|
||||
</select>
|
||||
<select name="v_id" style="display: inline;width: 100px" v-model="info.v_id">
|
||||
<select name="v_id" style="display: inline;width: 200px" v-model="info.v_id">
|
||||
<option value="">车型</option>
|
||||
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
||||
</select>
|
||||
@@ -102,6 +102,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="jszc">
|
||||
<div class="am-form-group wp70">
|
||||
<label class="am-para-label w140">代理店结佣方式:</label>
|
||||
<div class="am-para-input">
|
||||
<input id="proxy_type0" name="proxy_type" type="radio" value="0" v-model="info.proxy_type"/><label for="proxy_type0">返佣 (优惠额度=售价-底价)</label><br>
|
||||
<input id="proxy_type1" name="proxy_type" type="radio" value="1" v-model="info.proxy_type"/><label for="proxy_type1">票折 (优惠额度=售价-(底价-单车毛利))</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group wp50">
|
||||
<label class="am-para-label w140">代理店单车毛利:</label>
|
||||
<div class="am-para-input">
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<th width="10%"><span>裸车报价</span></th>
|
||||
<th width="10%"><span>车辆底价</span></th>
|
||||
<th width="6%"><span>代理店单车毛利</span></th>
|
||||
<th width="6%"><span>代理店单结佣方式</span></th>
|
||||
<th width="6%"><span>品牌店单车毛利</span></th>
|
||||
<!--
|
||||
<th width="6%"><span>保险利润</span></th>
|
||||
@@ -107,7 +108,7 @@
|
||||
<tbody>
|
||||
<template v-for="(v,i) in lists">
|
||||
<tr class="tl">
|
||||
<td colspan="11">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
|
||||
<td colspan="12">车型:<span style="font-weight: 600;color:#FF7F50;">{{v.title}}</span></td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>
|
||||
@@ -116,6 +117,7 @@
|
||||
</td>
|
||||
<td>{{v.price_car}}</td>
|
||||
<td>{{v.price_floor}}</td>
|
||||
<td>{{v.proxy_type}}</td>
|
||||
<td>{{v.proxy_profix_car}}</td>
|
||||
<td>{{v.profix_car}}</td>
|
||||
<!--
|
||||
|
||||
@@ -89,7 +89,11 @@ class Business extends Wxapp{
|
||||
$car['price_car'] = $row['price_car'];
|
||||
$car['price_floor'] = $row['price_floor'];
|
||||
$dis_money = $car['price_car'] - $car['price_floor'];
|
||||
$biz['type']==3 && in_array($city_id, array(350600, 350900)) && $dis_money = $dis_money - $row['proxy_profix_car']; # 230310 宁德 or 漳州 的代理店优惠额度
|
||||
if ($biz['type']==3 && $row['proxy_type'] == 1){
|
||||
# 选择【返佣】时:代理店优惠额度 = 售价 - 底价
|
||||
# 选择【票折】时:代理店优惠额度 = 售价 - (底价-代理店单车毛利)
|
||||
$dis_money = $dis_money + $row['proxy_profix_car'];
|
||||
}
|
||||
if($biz['id']==160){
|
||||
$dis_money = 200000;
|
||||
}
|
||||
|
||||
@@ -18,18 +18,29 @@ class Items_cost_model extends HD_Model
|
||||
public function update_total($id){
|
||||
$this->load->model('items/items_model');
|
||||
$this->load->model('receiver/order/receiver_orders_v2_model');
|
||||
$this->load->model('auto/auto_business_model');
|
||||
$row = $this->get(['id'=>$id]);
|
||||
if($row){
|
||||
$item_row = $this->items_model->get(['id'=>$row['item_id']]);
|
||||
$cost_json = json_decode($row['cost_json'],true);
|
||||
$promotion_json = json_decode($row['promotion_json'],true);
|
||||
$srv_json = json_decode($row['srv_json'],true);
|
||||
|
||||
$order_row = $this->receiver_orders_v2_model->get(['id'=>$row['o_id']], 'id, info_json, (select type from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_type');
|
||||
$biz_type = $order_row['biz_type'];
|
||||
$info_json = json_decode($order_row['info_json'],true);
|
||||
$business_id = $info_json['business_id'] ? $info_json['business_id'] : 0;
|
||||
$business_row = $business_id ? $this->auto_business_model->get(['id'=>$business_id]) : array();
|
||||
|
||||
//【销售收入合计】(实际售价+选装实收)
|
||||
$sale_price = $row['price'] + $srv_json['price_fine_select'];
|
||||
//【采购及加装成本合计】(采购成本 + 选装成本 + 选装工时费 )
|
||||
$buy_price = $item_row['buy_price'] + $cost_json['select_price'] + $cost_json['labor_price'];
|
||||
//【促销成本合计】(销售佣金+其他)
|
||||
$promotion_price = $promotion_json['sale_price'] + $promotion_json['other'];
|
||||
if ($biz_type == 3 && $business_row && $business_row['proxy_type'] == 1){
|
||||
$promotion_price = $promotion_json['other'];
|
||||
}
|
||||
//【整车采购成本】(采购成本-厂家补贴)
|
||||
$car_buy_price = $item_row['buy_price'] - $promotion_json['factory_price'];
|
||||
//【整车采购毛利】(销售收入合计 - 整车采购成本 - 促销成本合计 - 选装金额 -选装工时费)
|
||||
@@ -41,8 +52,6 @@ class Items_cost_model extends HD_Model
|
||||
合伙店取商务政策的固定值 (2)
|
||||
代理店没有水平业务 (3)
|
||||
*/
|
||||
$order_row = $this->receiver_orders_v2_model->get(['id'=>$row['o_id']], 'id, (select type from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_type');
|
||||
$biz_type = $order_row['biz_type'];
|
||||
$insurance_price = $fee_carno_price = $loan_price = $srv_price = 0;
|
||||
if ($biz_type == 1){
|
||||
//【保险收入合计】
|
||||
|
||||
Reference in New Issue
Block a user