owners_623_2
This commit is contained in:
@@ -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']]);
|
||||
|
||||
@@ -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 '<br>本次更新完成了:';
|
||||
echo '<br><br>成功更新 <span style="color: red;">' . $counts . '</span> 条';
|
||||
|
||||
Reference in New Issue
Block a user