1
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\controller\Base;
|
||||
use hashids\hashids;
|
||||
use think\Db;
|
||||
use think\captcha;
|
||||
use think\Cache;
|
||||
@@ -23,8 +24,21 @@ class User extends Base
|
||||
parent::__construct($request);
|
||||
}
|
||||
|
||||
public function pstest(){
|
||||
echo md5('mtrsuper999');
|
||||
|
||||
public function cusercode(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"num"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$list = $this->user_obj->where('state',0)->page($data['num'],1000)->select();
|
||||
foreach ($list as $v){
|
||||
$d['code'] = $this->creatUserCode($v['user_id']);
|
||||
$this->user_obj->where('user_id',$v['user_id'])->update($d);
|
||||
}
|
||||
echo 'done';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user