diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 2b645806..93e4b857 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -961,6 +961,7 @@ class Customer extends HD_Controller 'city_name' => '所在城市', 'county_name' => '所在地区', 'is_unlock' => '是否解锁', + 'unlock_time' => '解锁时间', // 'to_send' => '是否改派', 'c_time' => '建档时间', "p_time" => "派单时间", @@ -983,7 +984,7 @@ class Customer extends HD_Controller $status_arr = $this->customers_model->get_status(); unset($status_arr['-1']); if ($count) { - $fileds = "id, name, mobile, level, status, cs_biz_id,brand_id,series_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, p_time, sales_p_time, if(order_time>0, order_time,'') as order_time, u_time, c_brand, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name,un_lock,rid"; + $fileds = "id, name, mobile, level, status, cs_biz_id,brand_id,series_id, FROM_UNIXTIME(c_time) as c_time, if(dt_time>0, dt_time,'') as dt_time, p_time, sales_p_time, if(order_time>0, order_time,'') as order_time, u_time, c_brand, cf_id, of_id, of2_id, (SELECT biz_name FROM `lc_biz` where id = `lc_receiver_customers`.biz_id) as biz_name, (SELECT uname FROM `lc_app_licheb_users` where id = `lc_receiver_customers`.admin_id) as admin_name, biz_id, admin_id, wxqy, wxgr, (select city_name from lc_area where city_id = lc_receiver_customers.city_id limit 1) as city_name, (select county_name from lc_area where county_id = lc_receiver_customers.county_id limit 1) as county_name,un_lock,rid,unlock_time"; $rows = $this->customers_model->select($where, 'id desc', $page, $size, $fileds); $brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id')); $series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id')); @@ -1029,7 +1030,8 @@ class Customer extends HD_Controller 'wxgr_name' => $this->customers_model->wxgrAry($val['wxgr']), 'brand_detail' => $brand_detail, 'series_detail' => $series_detail, - 'is_unlock' => $is_unlock + 'is_unlock' => $is_unlock, + 'unlock_time' => $val['unlock_time'] != '0000-00-00 00:00:00' ? $val['unlock_time'] : '', ); if ($params['export_tag']) { diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index 7f2bb05d..e26f0e40 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -1572,7 +1572,11 @@ class Customers extends Wxapp if (!$row) { throw new Exception('数据不存在'); } - $res = $this->customers_model->update(['un_lock' => Receiver_customers_model::LOCK_STATUS_2], ['id' => $id]); + $updateData = [ + 'un_lock' => Receiver_customers_model::LOCK_STATUS_2, + 'unlock_time' => date('Y-m-d H:i:s') + ]; + $res = $this->customers_model->update($updateData, ['id' => $id]); if (!$res) { throw new Exception('保存失败', ERR_PARAMS_ERROR); }