|
@@ -4,7 +4,7 @@ declare (strict_types = 1);
|
|
|
namespace app\controller;
|
|
|
|
|
|
use app\model\Account;
|
|
|
-use think\facade\Cache;
|
|
|
+use app\model\AccountPlat;use think\facade\Cache;
|
|
|
use think\Exception;
|
|
|
use think\facade\Db;
|
|
|
use think\App;
|
|
@@ -171,6 +171,7 @@ class User extends Base
|
|
|
"position"=>$acc->accountitem->position??'',
|
|
|
"depart_name"=>$acc->depart_name,
|
|
|
"company_relaton"=>$acc->company_relaton,
|
|
|
+ "system_version"=>(new AccountPlat())->where(['account_id'=>$acc->id])->column('system_version','plat_code')
|
|
|
];
|
|
|
|
|
|
if($post['openId']!=''){
|
|
@@ -411,6 +412,7 @@ class User extends Base
|
|
|
'position'=>$acc->accountitem->position??'',
|
|
|
'depart_name'=>$acc->depart_name,
|
|
|
'company_relaton'=>$acc->company_relaton,
|
|
|
+ 'system_version'=>(new AccountPlat())->where(['account_id'=>$acc->id])->column('system_version','plat_code')
|
|
|
];
|
|
|
$token = makeToken($userinfo);
|
|
|
if ($token == '') $this->error('token生成失败',1003);
|
|
@@ -419,4 +421,20 @@ class User extends Base
|
|
|
$userinfo['token'] = $token;
|
|
|
$this->success('获取成功',$userinfo,0);
|
|
|
}
|
|
|
+
|
|
|
+ public function setSystemVer(){
|
|
|
+ $param = $this->request->only(['account_id' => '', 'plat_code' => '','system_version'=>''], 'post', 'trim');
|
|
|
+ $valid =Validate::rule([
|
|
|
+ 'account_id|账户主键'=>'require|number|egt:0',
|
|
|
+ 'plat_code|系统类型'=>'require|max:255|in:cx,st',
|
|
|
+ 'system_version|系统更新版本号'=>'require'
|
|
|
+ ]);
|
|
|
+ if($valid->check($param)==false) $this->error($valid->getError());
|
|
|
+ $accountPlat= new AccountPlat();
|
|
|
+ $info =$accountPlat->where($param)->findOrEmpty();
|
|
|
+ if($info->isEmpty()==false) $this->error('记录信息已存在',1003);
|
|
|
+ $accountPlat->where(["account_id"=>$param['account_id'],"plat_code"=>$param['plat_code']])->delete();
|
|
|
+ $pl= $accountPlat->save($param);
|
|
|
+ $pl? $this->success('记录成功',[],0): $this->error('记录失败',1003);;
|
|
|
+ }
|
|
|
}
|