Merge remote-tracking branch 'origin/develop' into akun
正在显示
6 个修改的文件
包含
20 行增加
和
37 行删除
| @@ -145,10 +145,8 @@ class OnlineController extends BaseController | @@ -145,10 +145,8 @@ class OnlineController extends BaseController | ||
| 145 | public function setQuestion(){ | 145 | public function setQuestion(){ |
| 146 | $this->request->validate([ | 146 | $this->request->validate([ |
| 147 | 'id'=>'required', | 147 | 'id'=>'required', |
| 148 | - 'question'=>'required' | ||
| 149 | ],[ | 148 | ],[ |
| 150 | 'id.required' => 'ID不能为空', | 149 | 'id.required' => 'ID不能为空', |
| 151 | - 'question.required' => 'question不能为空' | ||
| 152 | ]); | 150 | ]); |
| 153 | $onlineCheckModel = new OnlineCheck(); | 151 | $onlineCheckModel = new OnlineCheck(); |
| 154 | $rs = $onlineCheckModel->edit($this->param,['id'=>$this->param['id']]); | 152 | $rs = $onlineCheckModel->edit($this->param,['id'=>$this->param['id']]); |
| @@ -9,6 +9,7 @@ use App\Models\ASide\APublicModel; | @@ -9,6 +9,7 @@ use App\Models\ASide\APublicModel; | ||
| 9 | use App\Models\Channel\Channel; | 9 | use App\Models\Channel\Channel; |
| 10 | use App\Models\Domain\DomainInfo; | 10 | use App\Models\Domain\DomainInfo; |
| 11 | use App\Models\Manage\Manage; | 11 | use App\Models\Manage\Manage; |
| 12 | +use App\Models\Project\OnlineCheck; | ||
| 12 | use App\Models\Project\Project; | 13 | use App\Models\Project\Project; |
| 13 | use App\Models\Task\Task; | 14 | use App\Models\Task\Task; |
| 14 | use Illuminate\Support\Facades\DB; | 15 | use Illuminate\Support\Facades\DB; |
| @@ -73,9 +74,9 @@ class OptimizeController extends BaseController | @@ -73,9 +74,9 @@ class OptimizeController extends BaseController | ||
| 73 | $item['product_num'] = $data['product'] ?? 0; | 74 | $item['product_num'] = $data['product'] ?? 0; |
| 74 | $item['keyword_num'] = $item['key'] ?? 0; | 75 | $item['keyword_num'] = $item['key'] ?? 0; |
| 75 | $item['autologin_code'] = getAutoLoginCode($item['id']); | 76 | $item['autologin_code'] = getAutoLoginCode($item['id']); |
| 76 | - $item['article_num'] = ($data['blog'] ?? 0) + ($data['news'] ?? 0); | ||
| 77 | - $item['task_finish_num'] = Task::getNumByProjectId($item['id'], Task::STATUS_DOWN); | ||
| 78 | - $item['task_pending_num'] = Task::getNumByProjectId($item['id'], [Task::STATUS_DONGING, Task::STATUS_WAIT]); | 77 | +// $item['article_num'] = ($data['blog'] ?? 0) + ($data['news'] ?? 0); |
| 78 | +// $item['task_finish_num'] = Task::getNumByProjectId($item['id'], Task::STATUS_DOWN); | ||
| 79 | +// $item['task_pending_num'] = Task::getNumByProjectId($item['id'], [Task::STATUS_DONGING, Task::STATUS_WAIT]); | ||
| 79 | return $item; | 80 | return $item; |
| 80 | } | 81 | } |
| 81 | /** | 82 | /** |
| @@ -94,8 +95,11 @@ class OptimizeController extends BaseController | @@ -94,8 +95,11 @@ class OptimizeController extends BaseController | ||
| 94 | 'gl_project.type AS type', | 95 | 'gl_project.type AS type', |
| 95 | 'gl_project.created_at AS created_at', | 96 | 'gl_project.created_at AS created_at', |
| 96 | 'gl_project.cooperate_date AS cooperate_date', | 97 | 'gl_project.cooperate_date AS cooperate_date', |
| 98 | + 'gl_project.finish_remain_day AS finish_remain_day', | ||
| 99 | + 'gl_project.remain_day AS remain_day', | ||
| 97 | 'gl_project_online_check.id AS online_check_id', | 100 | 'gl_project_online_check.id AS online_check_id', |
| 98 | 'gl_project_online_check.question AS question', | 101 | 'gl_project_online_check.question AS question', |
| 102 | + 'gl_project_online_check.go_question AS go_question', | ||
| 99 | 'gl_project_online_check.optimist_status AS optimist_status', | 103 | 'gl_project_online_check.optimist_status AS optimist_status', |
| 100 | 'gl_project_online_check.qa_status AS qa_status', | 104 | 'gl_project_online_check.qa_status AS qa_status', |
| 101 | 'gl_project_payment.amount AS amount', | 105 | 'gl_project_payment.amount AS amount', |
| @@ -33,7 +33,7 @@ class ProjectUserController extends BaseController | @@ -33,7 +33,7 @@ class ProjectUserController extends BaseController | ||
| 33 | $query = $userModel->leftJoin('gl_project', 'gl_project_user.project_id', '=', 'gl_project.id') | 33 | $query = $userModel->leftJoin('gl_project', 'gl_project_user.project_id', '=', 'gl_project.id') |
| 34 | ->leftJoin('gl_project_role', 'gl_project_user.role_id', '=', 'gl_project_role.id'); | 34 | ->leftJoin('gl_project_role', 'gl_project_user.role_id', '=', 'gl_project_role.id'); |
| 35 | $query = $this->searchParam($query); | 35 | $query = $this->searchParam($query); |
| 36 | - $lists = $query->paginate($this->row, $this->selectParam(), 'page', $this->page); | 36 | + $lists = $query->orderBy('gl_project_user.id', 'desc')->paginate($this->row, $this->selectParam(), 'page', $this->page); |
| 37 | $this->response('列表',Code::SUCCESS,$lists); | 37 | $this->response('列表',Code::SUCCESS,$lists); |
| 38 | } | 38 | } |
| 39 | 39 |
| @@ -23,6 +23,7 @@ class UserController extends BaseController | @@ -23,6 +23,7 @@ class UserController extends BaseController | ||
| 23 | public function lists(UserModel $userModel){ | 23 | public function lists(UserModel $userModel){ |
| 24 | //TODO::搜索参数统一处理 | 24 | //TODO::搜索参数统一处理 |
| 25 | $this->map['project_id'] = $this->user['project_id']; | 25 | $this->map['project_id'] = $this->user['project_id']; |
| 26 | + $this->map['role_id'] = ['!=',0]; | ||
| 26 | $lists = $userModel->lists($this->map,$this->page,$this->row,$this->order,['id','name','mobile','created_at','wechat','status']); | 27 | $lists = $userModel->lists($this->map,$this->page,$this->row,$this->order,['id','name','mobile','created_at','wechat','status']); |
| 27 | $this->response('success',Code::SUCCESS,$lists); | 28 | $this->response('success',Code::SUCCESS,$lists); |
| 28 | } | 29 | } |
| @@ -42,6 +42,9 @@ class UserLogic extends BaseLogic | @@ -42,6 +42,9 @@ class UserLogic extends BaseLogic | ||
| 42 | if($info !== false){ | 42 | if($info !== false){ |
| 43 | $this->fail('当前手机号码已注册'); | 43 | $this->fail('当前手机号码已注册'); |
| 44 | } | 44 | } |
| 45 | + if(!isset($this->param['role']) || empty($this->param['role'])){ | ||
| 46 | + $this->fail('一个账号只允许一个超级管理员,请先添加角色'); | ||
| 47 | + } | ||
| 45 | $this->param['create_id'] = $this->user['id']; | 48 | $this->param['create_id'] = $this->user['id']; |
| 46 | $this->param['operator_id'] = $this->user['id']; | 49 | $this->param['operator_id'] = $this->user['id']; |
| 47 | $this->param['project_id'] = $this->user['project_id']; | 50 | $this->param['project_id'] = $this->user['project_id']; |
| @@ -74,7 +77,13 @@ class UserLogic extends BaseLogic | @@ -74,7 +77,13 @@ class UserLogic extends BaseLogic | ||
| 74 | } | 77 | } |
| 75 | $this->param['type'] = 1; | 78 | $this->param['type'] = 1; |
| 76 | $this->param['operator_id'] = $this->user['id']; | 79 | $this->param['operator_id'] = $this->user['id']; |
| 77 | - $this->edits(); | 80 | + if(isset($this->param['password']) && empty($this->param['password'])){ |
| 81 | + $this->param['password'] = base64_encode(md5($this->param['password'])); | ||
| 82 | + } | ||
| 83 | + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | ||
| 84 | + if($rs === false){ | ||
| 85 | + $this->fail('系统错误,请联系管理员'); | ||
| 86 | + } | ||
| 78 | return $this->success(); | 87 | return $this->success(); |
| 79 | } | 88 | } |
| 80 | 89 | ||
| @@ -107,33 +116,4 @@ class UserLogic extends BaseLogic | @@ -107,33 +116,4 @@ class UserLogic extends BaseLogic | ||
| 107 | //对应删除组织架构 | 116 | //对应删除组织架构 |
| 108 | return $this->success(); | 117 | return $this->success(); |
| 109 | } | 118 | } |
| 110 | - | ||
| 111 | - /** | ||
| 112 | - * @param $param | ||
| 113 | - * @remark :编辑用户 | ||
| 114 | - * @name :edits | ||
| 115 | - * @author :lyh | ||
| 116 | - * @method :post | ||
| 117 | - * @time :2023/6/17 16:41 | ||
| 118 | - */ | ||
| 119 | - public function edits(){ | ||
| 120 | - if(!isset($this->param['password']) || empty($this->param['password'])){ | ||
| 121 | - unset($this->param['password']); | ||
| 122 | - }else{ | ||
| 123 | - $this->param['password'] = base64_encode(md5($this->param['password'])); | ||
| 124 | - } | ||
| 125 | - $info = $this->model->read(['mobile'=>$this->param['mobile'], | ||
| 126 | - 'project_id'=>$this->user['project_id'],'id'=>['!=',$this->param['id']]]); | ||
| 127 | - if($info !== false){ | ||
| 128 | - $this->fail('当前手机号码已注册'); | ||
| 129 | - } | ||
| 130 | - //密码加密 | ||
| 131 | - $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | ||
| 132 | - if($rs === false){ | ||
| 133 | - $this->fail('系统错误,请联系管理员'); | ||
| 134 | - } | ||
| 135 | - //清空当前用户登录缓存 | ||
| 136 | - Cache::pull($this->user['token']); | ||
| 137 | - return $this->success(); | ||
| 138 | - } | ||
| 139 | } | 119 | } |
| @@ -23,7 +23,7 @@ class LoginAuthMiddleware | @@ -23,7 +23,7 @@ class LoginAuthMiddleware | ||
| 23 | */ | 23 | */ |
| 24 | public function handle(Request $request, Closure $next) | 24 | public function handle(Request $request, Closure $next) |
| 25 | { | 25 | { |
| 26 | - $manage = Cache::get(Common::MANAGE_TOKEN . $request->header('token')); | 26 | + $manage = LoginLogic::manage(); |
| 27 | if (!$manage) { | 27 | if (!$manage) { |
| 28 | return response(['code'=> Code::USER_LOGIN_ERROE,'message'=>'当前用户未登录']); | 28 | return response(['code'=> Code::USER_LOGIN_ERROE,'message'=>'当前用户未登录']); |
| 29 | } | 29 | } |
-
请 注册 或 登录 后发表评论