作者 lyh

变更数据

@@ -31,11 +31,6 @@ class AiBlogKeywordController extends BaseController @@ -31,11 +31,6 @@ class AiBlogKeywordController extends BaseController
31 */ 31 */
32 public function getKeywordInfo() 32 public function getKeywordInfo()
33 { 33 {
34 - $this->request->validate([  
35 - 'project_id'=>['required'],  
36 - ],[  
37 - 'project_id.required' => '项目ID不能为空',  
38 - ]);  
39 $data = $this->logic->getKeywordInfo(); 34 $data = $this->logic->getKeywordInfo();
40 $this->response('success',Code::SUCCESS,$data); 35 $this->response('success',Code::SUCCESS,$data);
41 } 36 }
@@ -31,7 +31,7 @@ class AiBlogKeywordLogic extends BaseLogic @@ -31,7 +31,7 @@ class AiBlogKeywordLogic extends BaseLogic
31 */ 31 */
32 public function getKeywordInfo() 32 public function getKeywordInfo()
33 { 33 {
34 - $data = $this->model->read(['project_id'=>$this->param['project_id']]); 34 + $data = $this->model->read(['project_id'=>$this->user['project_id']]);
35 return $this->success($data); 35 return $this->success($data);
36 } 36 }
37 37
@@ -44,11 +44,12 @@ class AiBlogKeywordLogic extends BaseLogic @@ -44,11 +44,12 @@ class AiBlogKeywordLogic extends BaseLogic
44 */ 44 */
45 public function saveKeyword() 45 public function saveKeyword()
46 { 46 {
47 - $data = $this->model->read(['project_id'=>$this->param['project_id']]); 47 + $data = $this->model->read(['project_id'=>$this->user['project_id']]);
48 if($data !== false){ 48 if($data !== false){
49 $id = $data['id']; 49 $id = $data['id'];
50 $this->model->edit($this->param,['id'=>$id]); 50 $this->model->edit($this->param,['id'=>$id]);
51 }else{ 51 }else{
  52 + $this->param['project_id'] = $this->user['project_id'];
52 $id = $this->model->addReturnId($this->param); 53 $id = $this->model->addReturnId($this->param);
53 } 54 }
54 return $this->success(['id'=>$id]); 55 return $this->success(['id'=>$id]);