作者 lyh

变更数据

@@ -78,6 +78,11 @@ class GeoController extends BaseController @@ -78,6 +78,11 @@ class GeoController extends BaseController
78 */ 78 */
79 public function getCount() 79 public function getCount()
80 { 80 {
  81 + $this->request->validate([
  82 + 'project_id' => 'required',
  83 + ], [
  84 + 'project_id.required' => '项目ID不能为空',
  85 + ]);
81 $data = $this->logic->getCount(); 86 $data = $this->logic->getCount();
82 $this->response('success', Code::SUCCESS, $data); 87 $this->response('success', Code::SUCCESS, $data);
83 } 88 }
@@ -114,7 +114,7 @@ class GeoLogic extends BaseLogic @@ -114,7 +114,7 @@ class GeoLogic extends BaseLogic
114 $geo_question_count = GeoQuestion::selectRaw('SUM(JSON_LENGTH(question)) as total_count')->value('total_count'); 114 $geo_question_count = GeoQuestion::selectRaw('SUM(JSON_LENGTH(question)) as total_count')->value('total_count');
115 $geo_pr_count = GeoLink::where('project_id',$this->param['project_id'])->count(); 115 $geo_pr_count = GeoLink::where('project_id',$this->param['project_id'])->count();
116 $geo_writings_count = GeoWritings::where('project_id',$this->param['project_id'])->count(); 116 $geo_writings_count = GeoWritings::where('project_id',$this->param['project_id'])->count();
117 - return $this->success(['geo_writings_count'=>$geo_writings_count,'$geo_pr_count'=>$geo_pr_count,'geo_question_count'=>$geo_question_count]); 117 + return $this->success(['geo_writings_count'=>$geo_writings_count,'geo_pr_count'=>$geo_pr_count,'geo_question_count'=>$geo_question_count]);
118 } 118 }
119 119
120 } 120 }