作者 赵彬吉

update

@@ -268,10 +268,10 @@ class ProductController extends BaseController @@ -268,10 +268,10 @@ class ProductController extends BaseController
268 $this->response('关键词不能为空', Code::SYSTEM_ERROR); 268 $this->response('关键词不能为空', Code::SYSTEM_ERROR);
269 } 269 }
270 $project_id = ProjectAiSetting::where('mch_id', $mch_id)->where('key', $key)->value('project_id'); 270 $project_id = ProjectAiSetting::where('mch_id', $mch_id)->where('key', $key)->value('project_id');
271 - if($project_id){ 271 + if(!$project_id){
272 $this->response('项目不存在', Code::SYSTEM_ERROR); 272 $this->response('项目不存在', Code::SYSTEM_ERROR);
273 } 273 }
274 - 274 +
275 ProjectServer::useProject($project_id); 275 ProjectServer::useProject($project_id);
276 276
277 $product = Product::whereFullText('title', $keyword)->inRandomOrder()->select(['title', 'intro', 'thumb'])->first(); 277 $product = Product::whereFullText('title', $keyword)->inRandomOrder()->select(['title', 'intro', 'thumb'])->first();