add-api-bak_mobile cancel_car

This commit is contained in:
lccsw
2021-12-01 17:29:08 +08:00
parent 85b5c6a296
commit 8398042ee2
9 changed files with 77 additions and 7 deletions
+29 -4
View File
@@ -25,6 +25,7 @@ class Orders extends HD_Controller
$this->load->model('app/liche/app_liche_orders_model');
$this->load->library('receiver/orders_entity');
$this->load->library('OrdersList');
}
public function index()
@@ -87,7 +88,6 @@ class Orders extends HD_Controller
$status_arr[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
}
$params['count_all'] = $this->orders_model->count(array("status>=" => 0, "biz_id<>" => 1, "brand_id<>" => 3));//全部
$this->load->library('OrdersList');
$params['list_type'] = 'all';
$result = $this->orderslist->lists($params['status_pid'], $params);
$this->data = $result;
@@ -97,7 +97,7 @@ class Orders extends HD_Controller
public function get()
{
$status_arr = $this->orders_model->statusAry(0);
$status_arr = $this->orders_model->statusAry();
$id = $this->input->get('id');
$row = $this->orders_model->get(['id' => $id]);
@@ -106,6 +106,8 @@ class Orders extends HD_Controller
if (!$row) {
return $this->show_json(SYS_CODE_FAIL, '订单不存在!');
}
$sub_status_cn = $this->orderslist->sub_status_cn($row['id'],$row['status']);
$sub_status_cn && $sub_status_cn = "-".$sub_status_cn;
$money_json = json_decode($row['money_json'], true);
$deposit = $row['deposit'];
$jsondata = $row['jsondata'] ? json_decode($row['jsondata'], true) : array();
@@ -117,7 +119,7 @@ class Orders extends HD_Controller
$row['price'] = number_format($row['price'], 2);
$row['deposit'] = number_format($deposit, 2);
$row['c_time'] = date('Y-m-d', $row['c_time']);
$row['sign_status_name'] = $status_arr['list'][$sign['status']];
$row['sign_status_name'] = $status_arr[$row['status']]['name'].$sub_status_cn;
$row['cf_title'] = $customers['cf_title'];
$row['payway'] = intval($row['payway']);
$row['item_id'] = intval($row['item_id']);
@@ -380,7 +382,6 @@ class Orders extends HD_Controller
//导出数据列表
public function export()
{
$this->load->library('OrdersList');
$params = $this->input->get();
$params['page'] = 1;
$params['size'] = 10000;
@@ -830,4 +831,28 @@ class Orders extends HD_Controller
$this->data['id'] = $this->input->get('id');
return $this->show_view('receiver/orders/add_paylog');
}
//取消配车
public function edit_ckcar(){
$this->load->model('items/items_model');
$id = $this->input->post('id');
$row = $this->orders_model->get(['id'=>$id]);
if(!$row || !$row['item_id']){
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
if($row['status']>5){
return $this->show_json(SYS_CODE_FAIL, '用户已确认车辆不能修改');
}else if ($row['status']==5){
$ck_row = $this->order_ckcars_model->get(['o_id'=>$row['id']]);
if($ck_row['status']>=2){
return $this->show_json(SYS_CODE_FAIL, '用户已确认车辆不能修改');
}
}
$res = $this->orders_model->update(['item_id'=>0],['id'=>$row['id']]);
if($res){
$this->items_model->update(['status' => 1,'bill_time'=>'0000-00-00 00:00:00'], ['id' => $row['item_id']]);
return $this->show_json(SYS_CODE_SUCCESS, '保存成功');
}else{
return $this->show_json(SYS_CODE_FAIL, '保存失败');
}
}
}
+25
View File
@@ -1636,6 +1636,31 @@ class OrdersList
array_unshift($data, $indexs);
return ['data'=>$data,'indexs'=>$indexs];
}
//获取子状态中文
public function sub_status_cn($oid,$status_pid){
if ($status_pid == 0) {
$this->ci->load->model('receiver/order/receiver_order_signs_model', 'sub_model');
} else if ($status_pid == 1) {
$this->ci->load->model('receiver/order/receiver_order_loans_model', 'sub_model');
} else if ($status_pid == 2) {
$this->ci->load->model('receiver/order/receiver_order_ckcars_model', 'sub_model');
} else if ($status_pid == 3) {
$this->ci->load->model('receiver/order/receiver_order_bills_model', 'sub_model');
} else if ($status_pid == 4) {
$this->ci->load->model('receiver/order/receiver_order_agents_model', 'sub_model');
} else if ($status_pid == 5) {
$this->ci->load->model('receiver/order/receiver_order_deliverys_model', 'sub_model');
} else{
return '';
}
$row = $this->ci->sub_model->get(['o_id'=>$oid],'status');
if(!$row){
return '';
}
$status_arr = $this->ci->mdOrders->statusAry($status_pid);
return $status_arr ? $status_arr['list'][$row['status']] : '';
}
}
?>
+12 -1
View File
@@ -17,7 +17,7 @@
</div>
</div>
<div class="am-form-group am-u-lg-4">
<label class="am-para-label label-width"><span class="span-bold">合同状态:</span></label>
<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.sign_status_name}}</label>
</div>
@@ -660,6 +660,17 @@
layer.msg(data.msg, {icon: 2});
}
}, 'json');
},
cancelItem:function(){
$.post("/receiver/orders/edit_ckcar", {id:this.info.id}, function (data) {
if (data.code) {
layer.msg(data.msg, {time: 2000, icon: 1}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
}, 'json');
}
}
});
+3 -1
View File
@@ -110,7 +110,9 @@
<div class="am-form-inline">
<div class="am-form-group am-u-lg-6">
<label class="am-para-label">
<a @click="carModal" class='am-btn am-btn-primary am-btn-xs'>车辆分配</a></label>
<a @click="cancelItem" v-if="info.item_id" class='am-btn am-btn-default am-btn-xs'>取消分配</a>
<a @click="carModal" v-else class='am-btn am-btn-primary am-btn-xs'>车辆分配</a>
</label>
</div>
</div>
</div>
@@ -73,6 +73,7 @@ class Cusorder extends Wxapp{
$entrust_mobile = $this->input_param('entrust_mobile');
$name = $this->input_param('name');
$mobile = $this->input_param('mobile');
$bak_mobile = $this->input_param('bak_mobile');
$address = $this->input_param('address');
$cardid = $this->input_param('cardid');
$delry_time = $this->input_param('delry_time');
@@ -172,6 +173,7 @@ class Cusorder extends Wxapp{
'deposit' => $deposit,
'c_time' => time()
];
$bak_mobile && $data['bak_mobile'] = $bak_mobile;
$payway && $data['payway'] = 1;
$main_type && $data['main_type'] = 1;
$delry_time && $data['delry_time'] = $delry_time;
@@ -47,6 +47,7 @@ class Cusorder2 extends Wxapp{
$cus_id = $this->input_param('cus_id');
$name = $this->input_param('name');
$mobile = $this->input_param('mobile');
$bak_mobile = $this->input_param('bak_mobile');
$address = $this->input_param('address');
$cardid = $this->input_param('cardid');
$ifentrust = $this->input_param('ifentrust');
@@ -77,6 +78,7 @@ class Cusorder2 extends Wxapp{
'admin_id' => $this->session['uid'],
'c_time' => time()
];
$bak_mobile && $data['bak_mobile'] = $bak_mobile;
$info_json = [];
$cardid && $info_json['c_cardid'] = $cardid;
$address && $info_json['c_address'] = $address;
@@ -385,6 +385,7 @@ class Customers extends Wxapp
$mobile = $this->input_param('mobile');
$cf_clues = $this->input_param('cf_clues');//线索来源
$admin_id = $this->input_param('admin_id');
$id = $this->input_param('id');
!$page && $page = 1;
!$size && $size = 10;
@@ -426,6 +427,7 @@ class Customers extends Wxapp
}
$unuse && $where['admin_id'] = 0;
$admin_id && $where['admin_id'] = $admin_id;
$id && $where['id'] = $id;
strlen($istop) && $where['is_top'] = $istop;
strlen($if_driver) && $where['if_driver'] = 1;
strlen($status) && $where['status'] = $status;
@@ -15,7 +15,7 @@ class Receiver_customers_model extends HD_Model
private $status_arr = [-1 => '删除', 0 => '未见客户', 1 => '到店客户', 2 => '订单客户', 3 => '战败客户'];
private $level = ['H', 'A', 'B', 'C', 'D'];
private $cfrom_arr = ['自有资源', '平台分配', '素材推广'];
private $cfrom_clues_arr = ['自然进店', '外展', 'DM', '转介绍', '其它','网站'];
private $cfrom_clues_arr = ['自然进店', '外展', 'DM', '转介绍', '其它','网站','外展外拓','垂直媒体','自媒体'];
private $buy_time = [3, 7, 15, 30];
public function __construct()
+1
View File
@@ -200,3 +200,4 @@ alter table lc_receiver_orders add srv_ids varchar(100) not null default '' comm
alter table lc_receiver_orders add fine_ids varchar(100) not null default '' comment '精品id多个逗号隔开' after srv_ids;
alter table lc_receiver_orders add bill_time timestamp not null default '0000-00-00 00:00:00' comment '开票时间' after delry_time;
alter table lc_receiver_orders add order_time timestamp not null default '0000-00-00 00:00:00' comment '下定时间' after bill_time;
alter table lc_receiver_orders add bak_mobile varchar(11) not null default '' comment '备用手机号' after mobile;