增加记录来源和报名对应cf_id
This commit is contained in:
@@ -29,8 +29,7 @@ abstract class BaseController extends REST_Controller
|
||||
];
|
||||
const SERVICE_PHONE = '13388887777';
|
||||
const APP_ID = 1; //应用id
|
||||
const DEFAULT_AVATAR = 'https://img.liche.cn/space/agentadmin/202507/p_8087d3cfe434bb7a76eb4a7a802b6195.jpg?imageView2/2/w/200/h/200/interlace/1';
|
||||
|
||||
const DEFAULT_AVATAR = 'https://img.liche.cn/liche/2025/11/77c2d0795e49dd06/e5a81f095b32724b.jpg?imageView2/2/w/200/h/200/interlace/1';
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -69,7 +69,7 @@ class Login extends BaseController
|
||||
{
|
||||
try {
|
||||
$accountId = $this->input_param('accountId');
|
||||
$from = $this->input_param('from');
|
||||
$cfrom = $this->input_param('cfrom');
|
||||
$mobile = $this->input_param('mobile');
|
||||
$code = $this->input_param('code');
|
||||
if (!mobile_valid($mobile)) {
|
||||
@@ -82,8 +82,9 @@ class Login extends BaseController
|
||||
if (!$cacheCode || $cacheCode != $code) {
|
||||
throw new Exception("验证码错误");
|
||||
}
|
||||
$otherInfo['cfrom'] = $cfrom;
|
||||
/** @var MyResponse $response */
|
||||
$response = $this->autoUserModel->initUser($mobile, '', $accountId, $from);
|
||||
$response = $this->autoUserModel->initUser($mobile, '', $accountId, '', $otherInfo);
|
||||
if (!$response->isSuccess()) {
|
||||
$this->return_json($response->getMessage());
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class BaseController extends REST_Controller
|
||||
self::CODE_LOGIN => 'PINGAN_LOGIN_%s',
|
||||
self::CODE_REGISTER => 'PINGAN_REGISTER_%s'
|
||||
];
|
||||
const DEFAULT_AVATAR = 'https://img.liche.cn/space/agentadmin/202507/p_8087d3cfe434bb7a76eb4a7a802b6195.jpg?imageView2/2/w/200/h/200/interlace/1';
|
||||
const DEFAULT_AVATAR = 'https://img.liche.cn/liche/2025/11/77c2d0795e49dd06/e5a81f095b32724b.jpg?imageView2/2/w/200/h/200/interlace/1';
|
||||
protected $groupType;
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -79,12 +79,18 @@ class Auto_user_coupon_model extends HD_Model
|
||||
if (!$res) {
|
||||
throw new Exception('领取失败');
|
||||
}
|
||||
$cf_id = $teamCf['cfId'] ?: 0;
|
||||
$cf2_id = $teamCf['cf2Id'] ?: 0;
|
||||
if ($user['cfrom'] == Auto_user_model::C_FROM_APP) { //来源app
|
||||
$cf_id = 38;
|
||||
$cf2_id = 43;
|
||||
}
|
||||
//增加留资记录
|
||||
$enrollData = [
|
||||
'sid' => $sid,
|
||||
'mobile' => $mobile,
|
||||
'cf_id' => $teamCf['cfId'] ?: 0,
|
||||
'cf2_id' => $teamCf['cf2Id'] ?: 0,
|
||||
'cf_id' => $cf_id,
|
||||
'cf2_id' => $cf2_id,
|
||||
'out_id' => $product['id'],
|
||||
'c_time' => time()
|
||||
];
|
||||
@@ -101,8 +107,8 @@ class Auto_user_coupon_model extends HD_Model
|
||||
'out_id' => $product['id'],
|
||||
'app_id' => $appId,
|
||||
'cf_uid' => $userId,
|
||||
'cf_id' => $teamCf['cfId'] ?: 0,
|
||||
'cf2_id' => $teamCf['cf2Id'] ?: 0,
|
||||
'cf_id' => $cf_id,
|
||||
'cf2_id' => $cf2_id,
|
||||
'c_time' => time(),
|
||||
];
|
||||
$data['brand_id'] = $product['brandId'] ?: 0;
|
||||
|
||||
@@ -6,6 +6,8 @@ class Auto_user_model extends HD_Model
|
||||
const STATUS_DELETE = -1; //删除
|
||||
const STATUS_DISABLE = 0; //禁用
|
||||
const STATUS_NORMAL = 1; //正常
|
||||
|
||||
const C_FROM_APP = 'app';//来源app
|
||||
private $table_name = 'lc_auto_user';
|
||||
const MAP_USER_MODEL = [
|
||||
'ain' => 'ain_users_model',
|
||||
@@ -68,6 +70,7 @@ class Auto_user_model extends HD_Model
|
||||
$otherInfo['nickname'] && $user['nickname'] = $otherInfo['nickname'];
|
||||
$otherInfo['headimg'] && $user['headimg'] = $otherInfo['headimg'];
|
||||
$otherInfo['unionid'] && $user['unionid'] = $otherInfo['unionid'];
|
||||
$otherInfo['cfrom'] && $user['cfrom'] = $otherInfo['cfrom'];
|
||||
$userId = $this->add($user);
|
||||
if (!$userId) {
|
||||
throw new Exception('添加用户失败');
|
||||
|
||||
Reference in New Issue
Block a user