cost add if_usedcar
This commit is contained in:
@@ -107,6 +107,14 @@ class Cost extends HD_Controller{
|
||||
!$params['biz_id_admin'] && $params['biz_id_admin'] = '';
|
||||
$params['admin_id'] = '';
|
||||
}
|
||||
//二手车
|
||||
if (strlen($params['if_usedcar'])) {
|
||||
$where_orders = $where_orders." and if_usedcar = {$params['if_usedcar']}";
|
||||
}
|
||||
else {
|
||||
$params['if_usedcar'] = '';
|
||||
}
|
||||
|
||||
if ($where_orders != $where_orders_default){
|
||||
$where["o_id in (select id from lc_receiver_orders_v2 where $where_orders)"] = null;
|
||||
}
|
||||
@@ -151,7 +159,7 @@ class Cost extends HD_Controller{
|
||||
$map_order = [];
|
||||
if($o_ids){
|
||||
$where = ["id in ($o_ids)" => null];
|
||||
$fields = "id, (select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name";
|
||||
$fields = "id, if_usedcar, (select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name";
|
||||
$order_rows = $this->receiver_orders_v2_model->select($where,'','','',$fields);
|
||||
foreach ($order_rows as $item) {
|
||||
$map_order[$item['id']] = $item;
|
||||
@@ -179,10 +187,11 @@ class Cost extends HD_Controller{
|
||||
$v_name = isset($attr[$item['v_id']]) ? $attr[$item['v_id']][0]['title'] : '';
|
||||
$srv_json = json_decode($val['srv_json'],true);
|
||||
$order = $map_order[$val['o_id']];
|
||||
$if_usedcar_name = $order['if_usedcar'] ? ' (二手车)':'';
|
||||
$lists[] = [
|
||||
'id' => $val['id'],
|
||||
'biz_name' => $order['biz_name'],
|
||||
'title' => "{$brand_name} {$series_name} {$v_name}",
|
||||
'title' => "{$brand_name} {$series_name} {$v_name}{$if_usedcar_name}",
|
||||
'vin' => $item['vin'],
|
||||
'sale_price' => $val['sale_price'],
|
||||
'buy_price' => $val['buy_price'],
|
||||
@@ -202,6 +211,7 @@ class Cost extends HD_Controller{
|
||||
}
|
||||
}
|
||||
$show_info['bizTypeAry'] = $this->biz_model->type_ary();//门店类型
|
||||
$show_info['usedcarAry'] = array(1=>'是', 0=>'否');
|
||||
$this->data['show_info'] = $show_info;
|
||||
#$autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name');
|
||||
$autoList[1] = $this->mdAutoBrand->map_brand(array('status > -1' => null), false);
|
||||
@@ -244,9 +254,10 @@ class Cost extends HD_Controller{
|
||||
!$srv_json['ori_price'] && $srv_json['ori_price'] = 0;
|
||||
$info = [
|
||||
'bill_name' => $row['bill_name'],
|
||||
'bill_time' => date('Y-m-d',strtotime($row['bill_time'])),
|
||||
'bill_time' => $row['bill_time'] !='0000-00-00 00:00:00' ? date('Y-m-d',strtotime($row['bill_time'])) : '',
|
||||
'price' => $row['price'],
|
||||
'bill_price' => $row['bill_price'],
|
||||
'if_usedcar_name' => $order_row['if_usedcar'] ? '是':'否',
|
||||
'vin' => $item_row['vin'],
|
||||
'ori_price' => $item_row['ori_price'],
|
||||
'buy_price' => $item_row['buy_price'],
|
||||
@@ -473,8 +484,9 @@ class Cost extends HD_Controller{
|
||||
$map_order = [];
|
||||
if($o_ids){
|
||||
$where = ["id in ($o_ids)" => null];
|
||||
$fields = "id, name, mobile, owner_name, owner_mobile, c_time, biz_id, admin_id, payway,
|
||||
if(payway=1,'全款','贷款') as payway_name,
|
||||
$fields = "id, name, mobile, owner_name, owner_mobile, c_time, biz_id, admin_id,
|
||||
payway, if(payway=1,'全款','贷款') as payway_name,
|
||||
if_usedcar, if(if_usedcar=1,'是','') as if_usedcar_name,
|
||||
(select type from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_type,
|
||||
(select biz_name from lc_biz where id = lc_receiver_orders_v2.biz_id) as biz_name,
|
||||
(select uname from lc_app_licheb_users where id = lc_receiver_orders_v2.admin_id) as admin_name";
|
||||
@@ -538,6 +550,7 @@ class Cost extends HD_Controller{
|
||||
'vin' => $item['vin'],
|
||||
'brand_name' => $brand_name,
|
||||
'series_name' => "{$series_name} {$v_name}",
|
||||
'if_usedcar_name' => $order['if_usedcar_name'],
|
||||
'ori_price' => $srv_json['ori_price'],
|
||||
|
||||
'owner_name' => $order['owner_name']."({$order['owner_mobile']})",
|
||||
@@ -631,6 +644,7 @@ class Cost extends HD_Controller{
|
||||
'vin' => '车架号',
|
||||
'brand_name' => '品牌',
|
||||
'series_name' => '车型',
|
||||
'if_usedcar_name' => '二手车',
|
||||
'ori_price' => '指导价',
|
||||
|
||||
'owner_name' => '车主', // 客户名称
|
||||
|
||||
@@ -62,7 +62,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group am-u-lg-4">
|
||||
|
||||
<label class="am-para-label label-width"><span class="span-bold">二手车:</span></label>
|
||||
<div class="am-para-input">
|
||||
<label class="am-para-label-con">{{info.if_usedcar_name}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,6 +51,15 @@
|
||||
<input type="text" name="vin" placeholder="车架号关键字" v-model="params.vin"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w80">二手车:</label>
|
||||
<div class="am-para-inline w80">
|
||||
<select name="if_usedcar" v-model="params.if_usedcar">
|
||||
<option value="">请选择</option>
|
||||
<option :value="i" v-for="(v,i) in show_info.usedcarAry">{{v}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="am-form-group fl">
|
||||
<label class="am-para-label w100">开票时间:</label>
|
||||
<div class="am-form-group fl">
|
||||
|
||||
Reference in New Issue
Block a user