edit-api-licheb-order_list

This commit is contained in:
lccsw
2021-09-26 16:00:45 +08:00
parent b33c2b1347
commit 9277a93044
11 changed files with 67 additions and 33 deletions
+32 -13
View File
@@ -128,32 +128,47 @@ class Series extends Wxapp{
$type = $this->input_param('type');
$page = $this->input_param('page');
$size = $this->input_param('size');
$v_id = $this->input_param('v_id');
$cor_id = $this->input_param('color_id');
!$page && $page = 1;
!$size && $size = 20;
$this->load->model('auto/auto_cars_model');
$this->load->model('auto/auto_attr_model');
$where = [
's_id' => $s_id
's_id' => $s_id,
'status' => 1
];
strlen($type) && $where['type'] = $type;
$count = $this->auto_attr_model->count($where);
$rows = $this->auto_attr_model->select($where,'id desc',$page,$size,'id,title,type,jsondata');
if($type==2){ //内饰颜色
$where['v_id'] = $v_id;
$where['cor_id'] = $cor_id;
$groupby = "incor_id";
}elseif($type==1){ //颜色
$where['v_id'] = $v_id;
$groupby = "cor_id";
}else{ //车辆级别
$groupby = "v_id";
}
$lists = [];
$rows = $this->auto_cars_model->select_groupby($groupby,$where,'',$page,$size,'id,s_id,v_id,cor_id,incor_id');
if($rows){
foreach($rows as $key=>$val){
$jsodnata = json_decode($val['jsondata'],true);
$temp = [
'id' => $val['id'],
'title' => $val['title']
];
$lists[] = $temp;
$target_arr = array_column($rows,$groupby);
$attrs = $this->auto_attr_model->get_map_by_ids($target_arr,'id,title');
foreach($rows as $key => $val){
$attr_id = $val[$groupby];
if($attrs[$attr_id]){
$lists[] = [
'id' => $attr_id,
'title' => $attrs[$attr_id][0]['title']
];
}
}
}
$data = [
'list' => $lists,
'total' => $count
'total' => count($lists)
];
return $data;
}
@@ -174,9 +189,13 @@ class Series extends Wxapp{
's_id'=>$s_id,
'v_id' => $v_id,
'cor_id' => $color_id,
'incor_id' => $incolor_id
'incor_id' => $incolor_id,
'status' => 1
);
$car = $this->auto_cars_model->get($where_car);
if(!$car){
throw new Exception('当前车型暂无库存', ERR_PARAMS_ERROR);
}
$data = [
'price' => $car['price_car'] ? $car['price_car'] : 0,
'deposit' => $car['price_book'] ? $car['price_book'] : 0
+12 -12
View File
@@ -238,16 +238,10 @@ class Cusorder extends Wxapp{
//订单列表头部
protected function get_tabs(){
$rows = $this->orders_model->get_status();
$lists = [];
if($rows){
foreach($rows as $key=>$val){
$lists[] = [
'key' => $key,
'name' => $val
];
}
}
$lists = [
['key' =>0 ,'name' => '进行中'],
['key' =>1 ,'name' => '已完成'],
];
return $lists;
}
@@ -260,7 +254,6 @@ class Cusorder extends Wxapp{
$biz_id = $this->session['new_biz_id'] ? $this->session['new_biz_id'] : intval($this->session['biz_id']);
$keyword = $this->input_param('keyword');
$status = $this->input_param('status');
//$ismy = $this->input_param('ismy'); //是否只显示自己
$page = $this->input_param('page');
$size = $this->input_param('size');
@@ -276,7 +269,12 @@ class Cusorder extends Wxapp{
if($keyword){
$where["(name='{$keyword}' or mobile='{$keyword}')"] = null;
}
strlen($status) && $where['status'] = $status;
if($status){ //已完成
$where['status'] = 6;
}else{ //进行中
$where['status>='] = 0;
$where['status!='] = 6;
}
$fileds = 'id,name,mobile,car_json,brand_id,s_id,deposit,payway,status,c_time';
$count = $this->orders_model->count($where);
$lists = [];
@@ -290,6 +288,7 @@ class Cusorder extends Wxapp{
$series = $this->auto_series_model->get_map_by_ids($series_arr,'id,name');
$status_arr = $this->orders_model->get_status();
$this->load->library('receiver/orders_entity');
foreach($rows as $key=>$val){
$car_json = json_decode($val['car_json'],true);
@@ -312,6 +311,7 @@ class Cusorder extends Wxapp{
'mobile' => mobile_asterisk($val['mobile']),
'status_name' => $status_arr[$val['status']],
'other_data' => $other_data,
'remark' => $this->orders_entity->get_remark($val['status'])
];
}
}
+1 -1
View File
@@ -64,7 +64,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:40%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -120,7 +120,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:40%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -28,7 +28,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:40%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -76,7 +76,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:40%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -45,7 +45,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:50%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -124,7 +124,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:50%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -32,7 +32,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:50%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
+1 -1
View File
@@ -80,7 +80,7 @@
<div>日期:<?=$day?></div>
</td>
<td style="width:50%;">
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>乙方(<?=$ifentrust?'托人':'买受人'?></div>
<div>日期:<?=$day?></div>
</td>
</tr>
@@ -634,6 +634,21 @@ class Orders_entity{
}
return $res;
}
/**
* 根据订单状态获取备注
* @param $status int 状态值
*/
public function get_remark($status){
$config = [
0 => '点击“邀请签名”,提醒客户签字并缴交定金',
1 => '分期业务会线下拉群,暂时无需操作',
2 => '需要提醒客户去狸车小程序确认车辆并签名',
3 => '需要上传客户身份证/营业执照',
4 => '整理上牌资料、国补资料发给客服',
5 => '客户提完车,需要点击“确认交付”'
];
return $config[$status] ? $config[$status] : '';
}
}
?>