From 42f25e8f8220cb2cecd8d5515eb7cf84054f63f8 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Tue, 16 Nov 2021 17:10:42 +0800 Subject: [PATCH] add-plan-order_time --- admin/libraries/OrdersList.php | 15 +++++++-- admin/views/receiver/order/lists.php | 16 +++++++++- api/controllers/plan/Temp.php | 31 +++++++++++++++++++ api/libraries/liche/Progressopt.php | 5 ++- .../receiver/Receiver_customers_model.php | 2 +- 5 files changed, 64 insertions(+), 5 deletions(-) diff --git a/admin/libraries/OrdersList.php b/admin/libraries/OrdersList.php index b272194c..07ff3eea 100644 --- a/admin/libraries/OrdersList.php +++ b/admin/libraries/OrdersList.php @@ -367,6 +367,16 @@ class OrdersList $where["{$t2}.c_time <="] = strtotime($c_time[1] . ' 23:59:59'); } } + //下定时间 + if ($params['order_time']) { + $order_time = explode(' ~ ', $params['order_time']); + if ($order_time[0]) { + $where["{$t2}.order_time >="] = $order_time[0]; + } + if ($order_time[1]) { + $where["{$t2}.order_time <="] = $order_time[1] . ' 23:59:59'; + } + } if ($params['brand_id']) {//品牌 $where["{$t2}.brand_id"] = $params['brand_id']; } else { @@ -434,7 +444,7 @@ class OrdersList $lists = []; if ($count) { $fileds = "$t1.id,$t1.o_id,$t1.status,"; - $fileds .= "$t2.rid,$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time, {$t2}.admin_id"; + $fileds .= "$t2.rid,$t2.sid,$t2.name,$t2.mobile,$t2.brand_id,$t2.s_id,$t2.v_id,$t2.cor_id,$t2.incor_id,$t2.price,$t2.deposit,$t2.payway,$t2.c_time, {$t2}.admin_id,{$t2}.order_time"; $rows = $this->ci->order_signs_model->select_order($where, "$t2.c_time desc", $page, $size, $fileds); $brand_arr = $series_arr = $v_arr = $cor_arr = $incor_arr = array(); $admin_ids = array(); @@ -512,6 +522,7 @@ class OrdersList $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'] && $cf_name = $cfroms[$customers[$val['rid']][0]['cf_id']][0]['title'].'(线上)
'; $customers[$val['rid']][0]['cf_clues'] && $cf_name .= $customers[$val['rid']][0]['cf_clues'].'(线下)'; $fields['cf_name'] = $cf_name; + $fields['order_time'] = $val['order_time'] != '0000-00-00 00:00:00' ? $val['order_time'] : ''; $lists[] = $fields; } } @@ -1566,7 +1577,7 @@ class OrdersList 'biz_name' => ['title' => '门店', 'width' => '10%'], 'price' => ['title' => '合同价', 'width' => '7%'], 'payway_name' => ['title' => '付款', 'width' => '5%'],'admin_name' => ['title' => '销售员', 'width' => '7%'], 'cf_title' => ['title' => '来源类型', 'width' => '8%'],'cf_name' => ['title' => '来源','width' => '10%'], - 'status_name' => ['title' => '合同状态', 'width' => '7%'], 'c_time' => ['title' => '订单时间', 'width' => '12%']]; + 'status_name' => ['title' => '合同状态', 'width' => '7%'], 'order_time' => ['title' => '下定时间', 'width' => '12%']]; $fields = array_merge($fields1, $fields2); } else if ($status_pid == 1) { $fields2 = ['title' => ['title' => '分期产品', 'width' => '15%'], diff --git a/admin/views/receiver/order/lists.php b/admin/views/receiver/order/lists.php index 1b8d7053..b2d1064c 100644 --- a/admin/views/receiver/order/lists.php +++ b/admin/views/receiver/order/lists.php @@ -229,7 +229,7 @@ - +
@@ -240,6 +240,17 @@
+ +
+ +
+
+ +
+
+
+
@@ -295,6 +306,9 @@ laydate.render({ elem: '#id-bill-time', range: '~' }); + laydate.render({ + elem: '#id-order-time', range: '~' + }); $('.id-day-btn').click(function () { var type = $(this).data('date'), date = '', d_obj = new Date(); switch (type) { diff --git a/api/controllers/plan/Temp.php b/api/controllers/plan/Temp.php index ddbd083e..7ff9df77 100644 --- a/api/controllers/plan/Temp.php +++ b/api/controllers/plan/Temp.php @@ -107,5 +107,36 @@ class Temp extends HD_Controller header('refresh:3;url=/plan/temp/receiver_customer?counts=' . $counts . '&size=' . $param['size'] . '&page=' . ($param['page'] + 1)); ob_end_flush();//输出全部内容到浏览器 } + //更新下定时间 + public function order_time(){ + $this->load->model('receiver/order/receiver_orders_model'); + $this->load->model('app/liche/app_liche_orders_model'); + $param = $this->input->get(); + $param['page'] = intval($param['page']); + $param['size'] = intval($param['size']); + !$param['size'] && $param['size'] = 50; + !$param['page'] && $param['page'] = 1; + + $where = [ + 'status>' => 0, + 'order_time' => '0000-00-00 00:00:00', + ]; + $rows = $this->receiver_orders_model->select($where, 'id ASC', $param['page'], $param['size'], 'id'); + if($rows){ + foreach($rows as $key=>$val){ + $pay_row = $this->app_liche_orders_model->get(['o_id'=>$val['id'],'status'=>1,'type'=>1]); + if(!$pay_row){ + $pay_row = $this->app_liche_orders_model->get(['o_id'=>$val['id'],'status'=>1,'type'=>4]); + } + if($pay_row){ + $this->receiver_orders_model->update(['order_time'=>$pay_row['pay_time']],['id'=>$val['id']]); + } + } + $ids = implode(',',array_column($rows,'id')); + echo "do:{$ids} "; + }else{ + echo 'finish'; + } + } } diff --git a/api/libraries/liche/Progressopt.php b/api/libraries/liche/Progressopt.php index 501d3f2e..a0d6150a 100644 --- a/api/libraries/liche/Progressopt.php +++ b/api/libraries/liche/Progressopt.php @@ -80,10 +80,13 @@ class Progressopt{ //获取狸车用户进度列表 public function lists($mobile){ + if(!$mobile){ + return []; + } $where = [ 'status>=' => 0, 'status<' => 6, - "(mobile={$mobile} or (ifentrust=1 and json_extract(info_json,'$.entrust_mobile')='{$mobile}'))" => null + "(mobile='{$mobile}' or (ifentrust=1 and json_extract(info_json,'$.entrust_mobile')='{$mobile}'))" => null ]; $rows = $this->ci->orders_model->select($where,'id asc','','','id,name,payway,money_json,status,s_id,v_id,cor_id,incor_id,srv_ids'); $progress_list = []; diff --git a/common/models/receiver/Receiver_customers_model.php b/common/models/receiver/Receiver_customers_model.php index 05903f9a..3460fd1a 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()