作者 lyh

gx导入项目脚本

@@ -1224,12 +1224,17 @@ class ProjectController extends BaseController @@ -1224,12 +1224,17 @@ class ProjectController extends BaseController
1224 * @time :2025/6/10 10:51 1224 * @time :2025/6/10 10:51
1225 */ 1225 */
1226 public function generateCountCharts(){ 1226 public function generateCountCharts(){
  1227 + $this->request->validate([
  1228 + 'project_id'=>'required',
  1229 + ],[
  1230 + 'project_id.required' => '项目id不能为空',
  1231 + ]);
1227 $noticeModel = new NoticeLog(); 1232 $noticeModel = new NoticeLog();
1228 $info = $noticeModel->read(['type'=>NoticeLog::TYPE_GENERATE_COUNT_CHARTS,'status'=>0,'data'=>['like','%"'.$this->param['project_id'].'"%']]); 1233 $info = $noticeModel->read(['type'=>NoticeLog::TYPE_GENERATE_COUNT_CHARTS,'status'=>0,'data'=>['like','%"'.$this->param['project_id'].'"%']]);
1229 if($info !== false){ 1234 if($info !== false){
1230 $this->fail('当前数据在生成中'); 1235 $this->fail('当前数据在生成中');
1231 } 1236 }
1232 - NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->user['project_id']]); 1237 + NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->param['project_id']]);
1233 $this->response('success'); 1238 $this->response('success');
1234 } 1239 }
1235 } 1240 }