作者 lyh

gx

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
... ...
... ... @@ -166,21 +166,15 @@ class ATemplateController extends BaseController
if (empty($referer) || false == in_array($referer, ['oa.cmer.com', 'quanqiusou.cn', 'zgjoa.globalso.com'])) {
$this->response('非法请求',Code::SYSTEM_ERROR, []);
}
$lists = $aTemplateLogic->aTemplateList($this->map,$this->page,$this->row,$this->order);
$filed = ['id','name','status','image','created_at'];
$lists = $aTemplateLogic->aTemplateList($this->map,$this->page,$this->row,$this->order,$filed);
$data = [];
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$data[] = [
'id' => $v['id'],
'name' => $v['name'],
'status' => $v['status'],
'image_link' => getImageUrl($v['image']),
'created_at' => $v['created_at']
];
$v['image_link'] = getImageUrl($v['image']);
$data[] = $v;
}
}
unset($lists['list']);
$lists['data'] = $data;
$this->response('success',Code::SUCCESS,$lists);
}
... ...
... ... @@ -195,14 +195,19 @@ class UserLogic extends BaseLogic
//获取当前用户的觉得
$roleModel = new ProjectRole();
$roleInfo = $roleModel->orderBy('id','asc')->first();
$info = $this->model->read(['role_id'=>0]);
if(!empty($info) || !empty($roleInfo)){
$this->fail('系统错误,请联系管理员');
}
try {
$this->model->edit(['role_id'=>$roleInfo['id']],['role_id'=>0]);
$this->model->edit(['role_id'=>$roleInfo['id']],['id'=>$info['id']]);
$this->model->edit(['role_id'=>0],['id'=>$this->param['id']]);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理员');
}
Common::del_user_cache($this->model, [$this->param['id'],$info['id']], 'A');
return $this->success();
}
}
... ...