This commit is contained in:
wangjinlei
2023-05-25 18:29:38 +08:00
parent 72f58ae072
commit c803f2748b
6 changed files with 466 additions and 218 deletions

View File

@@ -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';
}
/**