|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\api\controller;
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
+use AlibabaCloud\DBFS\DBFS;
|
|
use app\common\controller\Api;
|
|
use app\common\controller\Api;
|
|
use app\common\library\Ems;
|
|
use app\common\library\Ems;
|
|
use app\common\library\Sms;
|
|
use app\common\library\Sms;
|
|
@@ -915,7 +916,7 @@ class User extends Api
|
|
//
|
|
//
|
|
// if(!$userInfo){
|
|
// if(!$userInfo){
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- $field = 'id,avatar,nickname,is_goddess,is_auth,recharge_auth,vipStatus(vip_duetime) as is_vip,age,lng,lat,city_name,district_name,constellation,hobby_ids,profession,declaration,wechat,income,copy_mobile,mobile';
|
|
|
|
|
|
+ $field = 'id,avatar,nickname,is_goddess,is_auth,recharge_auth,vipStatus(vip_duetime) as is_vip,age,lng,lat,city_name,district_name,constellation,hobby_ids,profession,declaration,wechat,income,copy_mobile,mobile,is_auth_person';
|
|
$userInfo = \app\common\model\User::field($field)->where(['id'=>$user_id])->find();
|
|
$userInfo = \app\common\model\User::field($field)->where(['id'=>$user_id])->find();
|
|
$userInfo['hobby_ids'] = \app\common\model\Hobby::getHobbyNames($userInfo['hobby_ids']);
|
|
$userInfo['hobby_ids'] = \app\common\model\Hobby::getHobbyNames($userInfo['hobby_ids']);
|
|
// 获取是否有眼缘
|
|
// 获取是否有眼缘
|
|
@@ -970,7 +971,7 @@ class User extends Api
|
|
//
|
|
//
|
|
// if(!$userInfo){
|
|
// if(!$userInfo){
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
- $field = 'id,avatar,avatar_auth,gender,nickname,nickname_auth,is_goddess,is_auth,vipStatus(vip_duetime) as is_vip,vip_duetime,age,city_name,district_name,constellation,hobby_ids,expect_ids,profession,declaration,declaration_auth,money,wechat,wechat_auth,pre_user_id,copy_mobile,,mobile';
|
|
|
|
|
|
+ $field = 'id,avatar,avatar_auth,gender,nickname,nickname_auth,is_goddess,is_auth,vipStatus(vip_duetime) as is_vip,vip_duetime,age,city_name,district_name,constellation,hobby_ids,expect_ids,profession,declaration,declaration_auth,money,wechat,wechat_auth,pre_user_id,copy_mobile,mobile,is_auth_person';
|
|
$userInfo = \app\common\model\User::field($field)->where(['id'=>$user_id])->find();
|
|
$userInfo = \app\common\model\User::field($field)->where(['id'=>$user_id])->find();
|
|
$userInfo['vip_duetime'] = $userInfo['vip_duetime']?date('Y-m-d',$userInfo['vip_duetime']):"";
|
|
$userInfo['vip_duetime'] = $userInfo['vip_duetime']?date('Y-m-d',$userInfo['vip_duetime']):"";
|
|
if($userInfo['pre_user_id']>0) {
|
|
if($userInfo['pre_user_id']>0) {
|
|
@@ -1418,6 +1419,64 @@ class User extends Api
|
|
|
|
|
|
//查询真人认证动作
|
|
//查询真人认证动作
|
|
public function authpersontag() {
|
|
public function authpersontag() {
|
|
-
|
|
|
|
|
|
+ $name = Db::name('user_auth_person_tag')->orderRaw("rand()")->limit(1)->value('name');
|
|
|
|
+ if (!$name) {
|
|
|
|
+ $this->error('认证动作缺失,请联系管理员');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $this->success('查询成功', $name);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //真人认证
|
|
|
|
+ public function personauth() {
|
|
|
|
+ $info = Db::name('user_auth_person')->where(['user_id' => $this->auth->id])->find();
|
|
|
|
+ if ($info && $info['status'] == 0) {
|
|
|
|
+ $this->error('您已经申请过了,请勿重复操作!');
|
|
|
|
+ }
|
|
|
|
+ if ($info && $info['status'] == 1) {
|
|
|
|
+ $this->error('您已通过审核!');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $actname = input('actname', '', 'trim'); // 动作名称
|
|
|
|
+ $videofile = input('videofile', '', 'trim'); // 视频
|
|
|
|
+ if (!$videofile || !$actname) {
|
|
|
|
+ $this->error(__('Invalid parameters'));
|
|
|
|
+ }
|
|
|
|
+ if (iconv_strlen($actname, 'utf-8') > 128) {
|
|
|
|
+ $this->error('超出限制');
|
|
|
|
+ }
|
|
|
|
+ if (iconv_strlen($videofile, 'utf-8') > 255) {
|
|
|
|
+ $this->error('超出限制');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data = [];
|
|
|
|
+ $data["actname"] = $actname;
|
|
|
|
+ $data["videofile"] = $videofile;
|
|
|
|
+ $data["status"] = 0;
|
|
|
|
+ $data["updatetime"] = time();
|
|
|
|
+
|
|
|
|
+ //开启事务
|
|
|
|
+ Db::startTrans();
|
|
|
|
+ if (!$info) { //未认证
|
|
|
|
+ $data["user_id"] = $this->auth->id;
|
|
|
|
+ $data["createtime"] = time();
|
|
|
|
+ $res = Db::name('user_auth_person')->insertGetId($data);
|
|
|
|
+ } else { //认证被拒绝过
|
|
|
|
+ $res = Db::name('user_auth_person')->where(['id' => $info['id'], 'user_id' => $this->auth->id])->setField($data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!$res) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $this->error('提交失败');
|
|
|
|
+ }
|
|
|
|
+ $rt = Db::name('user')->where(['id' => $this->auth->id, 'is_auth_person' => $this->auth->is_auth_person])->setField('is_auth_person', 1);
|
|
|
|
+ if ($rt === false) {
|
|
|
|
+ Db::rollback();
|
|
|
|
+ $this->error('提交失败');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Db::commit();
|
|
|
|
+ $this->success("实名认证申请提交成功,请耐心等待审核");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|