From 97d7cce0f282581177d2cf488c88b4328afb2d85 Mon Sep 17 00:00:00 2001 From: dengbw Date: Thu, 23 Jun 2022 11:11:57 +0800 Subject: [PATCH] owners_623_2 --- api/controllers/plan/Liche.php | 24 +++++++++++++++++++++++- api/controllers/plan/Temp.php | 7 ++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/api/controllers/plan/Liche.php b/api/controllers/plan/Liche.php index f566245e..f19d59df 100644 --- a/api/controllers/plan/Liche.php +++ b/api/controllers/plan/Liche.php @@ -105,6 +105,8 @@ class Liche extends HD_Controller $this->load->model('receiver/order/receiver_order_agents_model', 'mdOrdersAgents'); $this->load->model('app/liche/app_liche_users_model', 'mdUsers'); $this->load->model('receiver/receiver_owners_model', 'mdOwners'); + $this->load->model('app/app_lichene_qy_model', 'mdWechatqy'); + $this->load->model("biz/biz_model", 'mdBiz'); $t1 = 'lc_receiver_orders_v2'; $t2 = 'lc_receiver_order_status'; $where = ["{$t2}.c_time>=" => $c_time, "{$t1}.status>=" => 0, "{$t1}.owner_name<>" => '', "{$t1}.owner_mobile<>" => '', @@ -112,7 +114,7 @@ class Liche extends HD_Controller $having = "total >= 1"; $orderby = "{$t2}.c_time asc"; $fileds = "{$t1}.id,{$t1}.brand_id,{$t1}.s_id,{$t1}.v_id,{$t1}.owner_name,{$t1}.owner_mobile,{$t1}.order_time,{$t1}.ck_time - ,{$t1}.info_json,{$t2}.c_time"; + ,{$t1}.info_json,{$t1}.biz_id,{$t2}.c_time"; $res = $this->mdOrders->selectOrders($where, $orderby, 1, $size, '', $fileds, $having); if (!$res) { if ($params['rds']) { @@ -141,6 +143,26 @@ class Liche extends HD_Controller $data = ['o_id' => $value['id'], 'uid' => $uid, 'name' => $value['owner_name'], 'mobile' => $value['owner_mobile'], 'birth_day' => $birth_day, 'sex' => $sex, 'brand_id' => $value['brand_id'], 's_id' => $value['s_id'], 'v_id' => $value['v_id'], 'order_time' => $value['order_time'], 'ck_time' => $value['ck_time'], 'car_num' => $car_num]; + if ($value['biz_id']) { + $re_biz = $this->mdBiz->get(['id' => $value['biz_id']]); + if ($re_biz) { + $data['province_id'] = $re_biz['province_id']; + $data['city_id'] = $re_biz['city_id']; + $data['county_id'] = $re_biz['county_id']; + } + } + if ($value['owner_mobile']) {//查找企微 + $re_qy = $this->mdWechatqy->get(['mobile' => $value['owner_mobile']]); + if ($re_qy) { + $data['wxqy'] = 1; + } else { + $re_use = $this->mdUsers->get(['mobile' => $value['owner_mobile'], 'status<>' => -1]); + if ($re_use['unionid']) { + $re_qy = $this->mdWechatqy->get(['unionid' => $re_use['unionid']]); + $re_qy && $data['wxqy'] = 1; + } + } + } $re = $this->mdOwners->get(['o_id' => $value['id']]); if ($re) { $this->mdOwners->update($data, ['id' => $re['id']]); diff --git a/api/controllers/plan/Temp.php b/api/controllers/plan/Temp.php index e10aa2df..905a0d3f 100644 --- a/api/controllers/plan/Temp.php +++ b/api/controllers/plan/Temp.php @@ -37,7 +37,12 @@ class Temp extends HD_Controller !$param['page'] && $param['page'] = 1; $counts = intval($param['counts']); ob_start(); //打开缓冲区 - $res = $this->mdOwners->select(['status>=' => 0], 'id asc', $param['page'], $param['size'], 'id,o_id,mobile'); + $where = ['status>=' => 0]; + $id = intval($param['id']); + if ($id) { + $where['id>='] = $id; + } + $res = $this->mdOwners->select($where, 'id asc', $param['page'], $param['size'], 'id,o_id,mobile'); if (!$res) { echo '
本次更新完成了:'; echo '

成功更新 ' . $counts . ' 条';