diff --git a/admin/controllers/receiver/Orders.php b/admin/controllers/receiver/Orders.php index ea33c2c2..3ee43f96 100644 --- a/admin/controllers/receiver/Orders.php +++ b/admin/controllers/receiver/Orders.php @@ -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, '保存失败'); + } + } } diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php index a6f6887d..08067763 100644 --- a/admin/libraries/OrdersList.php +++ b/admin/libraries/OrdersList.php @@ -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']] : ''; + } } ?> diff --git a/admin/views/receiver/orders/get.php b/admin/views/receiver/orders/get.php index 031ae53a..9eb01fbc 100644 --- a/admin/views/receiver/orders/get.php +++ b/admin/views/receiver/orders/get.php @@ -17,7 +17,7 @@
- +
@@ -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'); } } }); diff --git a/admin/views/receiver/orders/oinfo.php b/admin/views/receiver/orders/oinfo.php index 081dae00..b7cd28b5 100644 --- a/admin/views/receiver/orders/oinfo.php +++ b/admin/views/receiver/orders/oinfo.php @@ -110,7 +110,9 @@
diff --git a/api/controllers/wxapp/licheb/Cusorder.php b/api/controllers/wxapp/licheb/Cusorder.php index baf790e7..c723c22b 100644 --- a/api/controllers/wxapp/licheb/Cusorder.php +++ b/api/controllers/wxapp/licheb/Cusorder.php @@ -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; diff --git a/api/controllers/wxapp/licheb/Cusorder2.php b/api/controllers/wxapp/licheb/Cusorder2.php index 9a75ba9c..7cf6de40 100644 --- a/api/controllers/wxapp/licheb/Cusorder2.php +++ b/api/controllers/wxapp/licheb/Cusorder2.php @@ -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; diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 54985713..8f7517a2 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -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; diff --git a/common/models/receiver/Receiver_customers_model.php b/common/models/receiver/Receiver_customers_model.php index 3460fd1a..7f3b7b86 100644 --- a/common/models/receiver/Receiver_customers_model.php +++ b/common/models/receiver/Receiver_customers_model.php @@ -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() diff --git a/sql/receiver/order.sql b/sql/receiver/order.sql index b76b9b3f..71b346ec 100644 --- a/sql/receiver/order.sql +++ b/sql/receiver/order.sql @@ -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;