平安用户端
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
defined('WXAPP_APP') or exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . 'controllers/wxapp/Wxapp.php';
|
||||
|
||||
class Paic extends Wxapp
|
||||
{
|
||||
|
||||
function __construct($inputs, $app_key)
|
||||
{
|
||||
parent::__construct($inputs, $app_key);
|
||||
|
||||
$this->login_white = array();//登录白名单
|
||||
$this->check_status = array();//用户状态校验
|
||||
$this->check_mobile = array();//需要手机号
|
||||
$this->check_headimg = array();//授权微信信息
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
|
||||
}
|
||||
|
||||
//获取车系
|
||||
protected function get()
|
||||
{
|
||||
$page = $this->input_param('page');
|
||||
$size = $this->input_param('size');
|
||||
$keyword = $this->input_param('keyword');
|
||||
!$page && $page = 1;
|
||||
!$size && $size = 100;
|
||||
|
||||
$where = [
|
||||
'status' => App_paic_users_model::STATUS_NORMAL
|
||||
];
|
||||
if ($keyword) {
|
||||
$where["name like '%{$keyword}%'"] = null;
|
||||
}
|
||||
$count = $this->app_paic_users_model->count($where);
|
||||
$list = $this->app_paic_users_model->select($where, 'id desc', $page, $size, 'id,name');
|
||||
$data = [
|
||||
'list' => $list,
|
||||
'total' => $count
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ class Customers extends Wxapp
|
||||
$this->load->model('auto/auto_brand_model');
|
||||
$this->load->model("biz/biz_model");
|
||||
$this->load->library('receiver/customers_entity');
|
||||
$this->load->model('app/paic/app_paic_users_model');
|
||||
$this->biz_id = $this->get_biz_id();
|
||||
}
|
||||
|
||||
@@ -123,6 +124,8 @@ class Customers extends Wxapp
|
||||
}
|
||||
$brand = $this->auto_brand_model->get(['id' => $row['brand_id']]);
|
||||
$of_title = $row['of_id'] ? $this->get_cfTitle($row) : '';
|
||||
$paic_user = '';
|
||||
$row['cf_pid'] && $paic_user = $this->app_paic_users_model->get(['id' => $row['cf_pid']]);
|
||||
$data['baseinfo'] = [
|
||||
'name' => ['value' => $row['name'], 'cn' => '客户姓名'],
|
||||
'mobile' => ['value' => $this->get_mobile(['mobile' => $row['mobile'], 'rid' => $row['rid']]), 'cn' => '客户电话'],
|
||||
@@ -134,6 +137,8 @@ class Customers extends Wxapp
|
||||
'wxgrimg_url' => $row['wxgrimg'] ? build_qiniu_image_url($row['wxgrimg']) : '',
|
||||
'brand' => ['id' => $row['brand_id'], 'name' => $brand['name']],
|
||||
'series_id' => $row['series_id'],
|
||||
'cf_pid' => $row['cf_pid'],
|
||||
'cf_name' => $paic_user['name'] ?: '',
|
||||
];
|
||||
return $data;
|
||||
}
|
||||
@@ -226,6 +231,7 @@ class Customers extends Wxapp
|
||||
$wxgrimg = $this->input_param('wxgrimg'); //个微截图
|
||||
$brand_id = (int)$this->input_param('brand_id');
|
||||
$series_id = (int)$this->input_param('series_id');
|
||||
$cf_pid = (int)$this->input_param('cf_pid');
|
||||
$row = $this->customers_model->get(['id' => $id]);
|
||||
if (!$row) {
|
||||
throw new Exception('参数错误', ERR_PARAMS_ERROR);
|
||||
@@ -260,6 +266,7 @@ class Customers extends Wxapp
|
||||
$update['level'] = $this->customers_entity->cal_level($buy_time);
|
||||
$update['buy_time'] = $buy_time;
|
||||
}
|
||||
$update['cf_pid'] = $cf_pid ?: 0;
|
||||
$update && $this->customers_model->update($update, ['id' => $id]);
|
||||
//客户标签
|
||||
if ($tag) {
|
||||
@@ -326,6 +333,7 @@ class Customers extends Wxapp
|
||||
$brand_id = $this->input_param('brand_id');
|
||||
$series_id = $this->input_param('series_id');
|
||||
$car_id = $this->input_param('car_id');
|
||||
$cf_pid = $this->input_param('cf_pid');
|
||||
if (!mobile_valid($mobile)) throw new Exception('请输入正确的手机号码', ERR_PARAMS_ERROR);
|
||||
if (!$city_id || !$county_id) {
|
||||
throw new Exception('请选择城市与行政区', API_CODE_FAIL);
|
||||
@@ -393,6 +401,7 @@ class Customers extends Wxapp
|
||||
$of2_id && $add_data['of2_id'] = $of2_id;
|
||||
$brand_id && $add_data['brand_id'] = $brand_id;
|
||||
$series_id && $add_data['series_id'] = $series_id;
|
||||
$cf_pid && $add_data['cf_pid'] = $cf_pid;
|
||||
$id = $this->customers_model->add($add_data);
|
||||
if ($id) {
|
||||
//客户标签
|
||||
@@ -768,7 +777,7 @@ class Customers extends Wxapp
|
||||
];
|
||||
}
|
||||
|
||||
if($this->biz_id == 10){
|
||||
if ($this->biz_id == 10) {
|
||||
$lists[] = ['id' => 20, 'name' => '中台直播'];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user