Commit eec1f26a authored by pengfei's avatar pengfei

Merge branch 'colonel' into test

parents 9f9fa5ad e13eb703
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 1:36 下午
*/
use App\Base\Job;
use Api\PhpServices\Idgen\Idgen;
......@@ -16,7 +11,7 @@ use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\HttpUtil;
use App\Models\user\mysql\UserWechatBind;
class ColonelOrderController extends Job
class ColonelorderController extends Job
{
const DEFAULT_USER_BATCH_SIZE = 100;
......
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 2:28 下午
*/
use App\Base\Job;
use Api\PhpUtils\Log\FileLog;
......@@ -11,7 +6,7 @@ use App\Models\marketing\mysql\ColonelDistributorPayInfo;
use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\HttpUtil;
class ColonelWalletController extends Job
class ColonelwalletController extends Job
{
public function indexAction()
{
......
......@@ -92,10 +92,16 @@ class UserService
return $user;
}
/**
* 绑定手机号
* @param $params
* @return \Api\PhpUtils\Mysql\MysqlBase
* @throws UserException
* @throws \App\Exception\custom\CodeSpecialException
* @throws \App\Exception\custom\InterfaceException
*/
public static function bindPhone($params)
{
$openid = !empty($params['openid']) ? $params['openid'] : '';
$encryptedData = !empty($params['encryptedData']) ? $params['encryptedData'] : '';
$iv = !empty($params['iv']) ? $params['iv'] : '';
......@@ -116,19 +122,11 @@ class UserService
throw new UserException(['cus' => 5]);
}
//解密
$decryptData = [];
$wXBizDataCrypt = new WxBizDataCrypt($appid, $sessionKey);
$errCode = $wXBizDataCrypt->decryptData($encryptedData, $iv, $decryptData);
if ($errCode) {
throw new UserException(['cus' => 6]);
}
......@@ -139,7 +137,6 @@ class UserService
}
$phoneNumber = strval($decryptData['phoneNumber']);
//判断是否已
$user = UserWechatBind::getRecord(['phone' => $phoneNumber]);
if (!empty($user) && $openid != $user['openid']) {
......@@ -164,8 +161,6 @@ class UserService
throw new UserException(['cus' => 8]);
}
CommonService::isNewUser($params);
$isNewUser = CommonService::isNewUser(['openid' => $openid]);
if (!empty($isNewUser) && $isNewUser['is_new_user'] == 1) {
$userInfo['is_pop_up'] = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment