|
|
@@ -8,6 +8,7 @@ namespace app\api\controller;
|
|
|
|
|
|
use app\weixin\model\Advice;
|
|
|
use app\weixin\model\Complain;
|
|
|
+use app\weixin\service\IdnAuth;
|
|
|
use function AlibabaCloud\Client\value;
|
|
|
use app\weixin\model\AccountLog;
|
|
|
use app\weixin\model\Meals;
|
|
|
@@ -88,6 +89,7 @@ class MemberController extends BaseController
|
|
|
$memberInfo['collectCount'] = UserCollect::getUserCount($userId, $memberInfo['vip_auth']);
|
|
|
$memberInfo['rechargeCount'] = Member::getRechargeCount($userId);
|
|
|
$memberInfo['messageCount'] = Member::getMessageTotal($userId, ['type' => 1, 'status' => 2]);
|
|
|
+ $memberInfo['accessCount'] = Member::getAccessCount($userId);
|
|
|
}
|
|
|
|
|
|
if ($type == 2) {
|
|
|
@@ -135,7 +137,7 @@ class MemberController extends BaseController
|
|
|
$memberInfo['authInfo'] = $authData;
|
|
|
}
|
|
|
if ($type == 6) {
|
|
|
- $field = 'graduate,education,education_img,education_fail,education_check';
|
|
|
+ $field = 'graduate,education,education_img,education_fail,education_check,education_code,education_type';
|
|
|
$authData = UserProfile::where(['userid' => $userId])
|
|
|
->field($field)
|
|
|
->find();
|
|
|
@@ -144,7 +146,7 @@ class MemberController extends BaseController
|
|
|
$memberInfo['authInfo'] = $authData ? $authData : [];
|
|
|
}
|
|
|
if ($type == 7) {
|
|
|
- $field = 'company,occupation,position_img,position_fail,position_check';
|
|
|
+ $field = 'company,occupation,position_img,position_fail,position_check,position_type,position_hide';
|
|
|
$authData = UserProfile::where(['userid' => $userId])
|
|
|
->field($field)
|
|
|
->find();
|
|
|
@@ -181,6 +183,13 @@ class MemberController extends BaseController
|
|
|
$memberInfo['contact_time'] = $contactTime;
|
|
|
}
|
|
|
|
|
|
+ if($type == 9){
|
|
|
+ $accountConfig = cmf_get_option('account_config');
|
|
|
+ $pay = isset($accountConfig['lock_access_pay']) ? intval($accountConfig['lock_access_pay']) : 0;
|
|
|
+ $pay = $pay ? $pay : 1;
|
|
|
+ $memberInfo['lock_access_pay'] = $pay;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
showJson(1005, 1001, $memberInfo);
|
|
|
@@ -677,6 +686,11 @@ class MemberController extends BaseController
|
|
|
$userId = $id ? $id : $this->userId;
|
|
|
$myInfo = Member::getHomeInfo($userId, '', $type);
|
|
|
|
|
|
+ // 访问记录
|
|
|
+ if($myInfo && $type == 4){
|
|
|
+ Member::makeUserAccess($userId, $this->userId);
|
|
|
+ }
|
|
|
+
|
|
|
$cUserInfo = [];
|
|
|
$cInfo = [];
|
|
|
if ($cid <= 0 && $id) {
|
|
|
@@ -921,6 +935,7 @@ class MemberController extends BaseController
|
|
|
switch ($scene) {
|
|
|
case 'idcard': // 身份证认证
|
|
|
$idcard = isset($params['idcard']) ? trim($params['idcard']) : '';
|
|
|
+ $realname = isset($params['realname'])? trim($params['realname']) : '';
|
|
|
$profileData = [
|
|
|
'idcard' => $idcard,
|
|
|
'front_idcard' => isset($params['front_idcard']) ? trim($params['front_idcard']) : '',
|
|
|
@@ -936,40 +951,30 @@ class MemberController extends BaseController
|
|
|
showJson(1004, 2128);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- // 身份证照片
|
|
|
- /*if (isset($_FILES['image1'])) {
|
|
|
- $file1 = request()->file('image1');
|
|
|
- $fileData = Storage::uploadImg($file1, 'auth');
|
|
|
- $frontIdcard = isset($fileData['file']) ? $fileData['file'] : '';
|
|
|
- $profileData['front_idcard'] = $waterTxt ? Storage::imageWater($frontIdcard, $waterTxt) : $frontIdcard;
|
|
|
+ // 在线验证
|
|
|
+ $checkData = IdnAuth::check($realname, $idcard);
|
|
|
+ $code = isset($checkData['code'])? $checkData['code'] : '';
|
|
|
+ $msg = isset($checkData['msg'])? $checkData['msg'] : '';
|
|
|
+ if($code != 'success' && (empty($profileData['front_idcard']) || empty($profileData['back_idcard']))){
|
|
|
+ showJson(1004, $msg? $msg : 2138);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- //$file2 = isset($_FILES['image2'])? $_FILES['image2'] : null;
|
|
|
- $files = request()->file();
|
|
|
- if (isset($_FILES['image2'])) {
|
|
|
- $file2 = request()->file('image2');
|
|
|
- $fileData = Storage::uploadImg($file2, 'auth');
|
|
|
- $backIdcard = isset($fileData['file']) ? $fileData['file'] : '';
|
|
|
- $profileData['back_idcard'] = $waterTxt ? Storage::imageWater($backIdcard, $waterTxt) : $backIdcard;
|
|
|
- }*/
|
|
|
-
|
|
|
- if (empty($profileData['front_idcard'])) {
|
|
|
+ // 身份证照片
|
|
|
+ /*if (empty($profileData['front_idcard'])) {
|
|
|
showJson(1004, 2024);
|
|
|
}
|
|
|
if (empty($profileData['back_idcard'])) {
|
|
|
showJson(1004, 2025);
|
|
|
- }
|
|
|
-
|
|
|
-// var_dump($profileData);exit;
|
|
|
+ }*/
|
|
|
|
|
|
Db::startTrans();
|
|
|
- if (!Member::saveData(['id' => $this->userId], ['real_name' => trim($params['realname'])])) {
|
|
|
+ if (!Member::saveData(['id' => $this->userId], ['real_name' => $realname])) {
|
|
|
Db::rollback();
|
|
|
showJson(1004, 2026);
|
|
|
}
|
|
|
|
|
|
+ // 在线验证是否通过
|
|
|
+ $profileData['idcard_online_check'] = $code == 'success'? 1 : 0;
|
|
|
if (UserProfile::checkProfile($this->userId)) {
|
|
|
$profileData['updated_at'] = date('Y-m-d H:i:s');
|
|
|
$res = UserProfile::saveData(['userid' => $this->userId], $profileData);
|
|
|
@@ -993,6 +998,8 @@ class MemberController extends BaseController
|
|
|
'graduate' => isset($params['graduate']) ? trim($params['graduate']) : '',
|
|
|
'education' => isset($params['education']) ? trim($params['education']) : '',
|
|
|
'education_img' => isset($params['education_img']) ? trim($params['education_img']) : '',
|
|
|
+ 'education_code' => isset($params['education_code']) ? trim($params['education_code']) : '',
|
|
|
+ 'education_type' => isset($params['education_type']) ? intval($params['education_type']) : 0,
|
|
|
'education_check' => 1,
|
|
|
];
|
|
|
|
|
|
@@ -1035,6 +1042,8 @@ class MemberController extends BaseController
|
|
|
'company' => isset($params['company']) ? trim($params['company']) : '',
|
|
|
'occupation' => isset($params['occupation']) ? trim($params['occupation']) : '',
|
|
|
'position_img' => isset($params['position_img']) ? trim($params['position_img']) : '',
|
|
|
+ 'position_type' => isset($params['position_type']) ? intval($params['position_type']) : 0,
|
|
|
+ 'position_hide' => isset($params['position_hide']) ? intval($params['position_hide']) : 0,
|
|
|
'position_check' => 1,
|
|
|
];
|
|
|
|
|
|
@@ -1605,5 +1614,49 @@ class MemberController extends BaseController
|
|
|
session('openid', null);
|
|
|
showJson(1005, 1001);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 认证记录
|
|
|
+ * @throws \think\Exception\DbException
|
|
|
+ */
|
|
|
+ public function getAuthNotice(){
|
|
|
+ $dataList = \app\weixin\service\Member::getAuthNotices();
|
|
|
+ showJson(1005, 1001, $dataList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户访问记录
|
|
|
+ */
|
|
|
+ public function getUserAccess(){
|
|
|
+ $pageSize = input('pageSize', 30);
|
|
|
+ $dataList = Member::getUserAccess($this->userId, $pageSize);
|
|
|
+ showJson(1005, 1001, $dataList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 解锁访问用户信息
|
|
|
+ */
|
|
|
+ public function unlock(){
|
|
|
+ $uid = input('uid', 0);
|
|
|
+ $cuid = input('cuid', 0);
|
|
|
+ if(empty($uid) || empty($cuid)){
|
|
|
+ showJson(1004,1012);
|
|
|
+ }
|
|
|
+
|
|
|
+ if($uid != $this->userId || ($uid == $cuid)){
|
|
|
+ showJson(1004,8301);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (UserProfile::where(['userid' => $this->userId])->value('idcard_check') != 2) {
|
|
|
+ showJson(1006, 2132, ['url' => Wechat::makeRedirectUrl(url('/weixin/auth/idcard', '', '', true))]);
|
|
|
+ }
|
|
|
+
|
|
|
+ $res = Member::catchUnlock($uid, $cuid);
|
|
|
+ if (is_array($res)) {
|
|
|
+ showJson(1005, 8302);
|
|
|
+ } else {
|
|
|
+ showJson(1004, $res ? $res : 8303);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|