You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
62 lines
1.6 KiB
2 months ago
|
<?php
|
||
|
|
||
|
namespace app\api\controller;
|
||
|
|
||
|
use app\common\controller\Api;
|
||
|
use app\common\library\Ems;
|
||
|
use app\common\library\Sms;
|
||
|
use app\admin\model\user\Shenhe;
|
||
|
use fast\Random;
|
||
|
use think\Config;
|
||
|
use think\Validate;
|
||
|
|
||
|
/**
|
||
|
* 会员接口
|
||
|
*/
|
||
|
class Usershenhe extends Api
|
||
|
{
|
||
|
protected $noNeedLogin = [];
|
||
|
protected $noNeedRight = '*';
|
||
|
|
||
|
public function _initialize()
|
||
|
{
|
||
|
parent::_initialize();
|
||
|
$this->model = new Shenhe;
|
||
|
if (!Config::get('fastadmin.usercenter')) {
|
||
|
$this->error(__('User center already closed'));
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 提交审核
|
||
|
*/
|
||
|
public function setshenhe()
|
||
|
{
|
||
|
$data = $this->request->post();
|
||
|
if ($this->request->isPost()){
|
||
|
$insert['user_id'] = $this->auth->id;
|
||
|
$insert['realname'] = $data['realname'];
|
||
|
$insert['cardno'] = $data['cardno'];
|
||
|
$insert['cardno_z'] = $data['cardno_z'];
|
||
|
$insert['cardno_f'] = $data['cardno_f'];
|
||
|
$insert['createtime'] = date("Y-m-d H:i:s",time());
|
||
|
if($this->model->insert($insert)) {
|
||
|
return $this->success('提交成功,待管理审核');
|
||
|
}else{
|
||
|
return $this->error('提交失败,请重新提交');
|
||
|
}
|
||
|
}
|
||
|
return $this->error('非法请求');
|
||
|
}
|
||
|
public function getinfo(){
|
||
|
$uid = $this->auth->id;
|
||
|
$info = $this->model->where('user_id',$uid)->order(['id'=>'desc'])->find();
|
||
|
if(!$info){
|
||
|
$info['status'] = -2;
|
||
|
}
|
||
|
return $this->success('获取成功',$info);
|
||
|
}
|
||
|
|
||
|
}
|