作者 Your Name
@@ -314,17 +314,17 @@ class PrivateController extends BaseController @@ -314,17 +314,17 @@ class PrivateController extends BaseController
314 $product = Product::where(['status' => Product::STATUS_ON])->where('created_at', '>=', $date)->pluck('route'); 314 $product = Product::where(['status' => Product::STATUS_ON])->where('created_at', '>=', $date)->pluck('route');
315 $news = News::where(['status' => News::STATUS_ONE])->where('release_at', '>', $date)->pluck('url'); 315 $news = News::where(['status' => News::STATUS_ONE])->where('release_at', '>', $date)->pluck('url');
316 $blog = Blog::where(['status' => Blog::STATUS_ONE])->where('release_at', '>', $date)->pluck('url'); 316 $blog = Blog::where(['status' => Blog::STATUS_ONE])->where('release_at', '>', $date)->pluck('url');
317 - $keyword = Keyword::where('created_at', '>', $date)->pluck('route'); 317 +// $keyword = Keyword::where('created_at', '>', $date)->pluck('route');
318 318
319 // 组装链接 319 // 组装链接
320 foreach ($product as $item) { 320 foreach ($product as $item) {
321 $url = 'https://' . $domain . '/' . $item; 321 $url = 'https://' . $domain . '/' . $item;
322 array_push($result, $url); 322 array_push($result, $url);
323 } 323 }
324 - foreach ($keyword as $item) {  
325 - $url = 'https://' . $domain . '/' . $item;  
326 - array_push($result, $url);  
327 - } 324 +// foreach ($keyword as $item) {
  325 +// $url = 'https://' . $domain . '/' . $item;
  326 +// array_push($result, $url);
  327 +// }
328 foreach ($news as $item) { 328 foreach ($news as $item) {
329 $url = 'https://' . $domain . '/news/' . $item; 329 $url = 'https://' . $domain . '/news/' . $item;
330 array_push($result, $url); 330 array_push($result, $url);
@@ -105,10 +105,8 @@ class DetailController extends BaseController @@ -105,10 +105,8 @@ class DetailController extends BaseController
105 public function saveDetail(DetailLogic $logic){ 105 public function saveDetail(DetailLogic $logic){
106 $this->request->validate([ 106 $this->request->validate([
107 'product_id'=>'required', 107 'product_id'=>'required',
108 - 'data'=>'required',  
109 ],[ 108 ],[
110 'product_id.required' => '产品id不能为空', 109 'product_id.required' => '产品id不能为空',
111 - 'data.required' => 'data不能为空',  
112 ]); 110 ]);
113 $data = $logic->saveDetail(); 111 $data = $logic->saveDetail();
114 $this->response('success',Code::SUCCESS,$data); 112 $this->response('success',Code::SUCCESS,$data);
@@ -51,6 +51,7 @@ class DetailLogic extends BaseLogic @@ -51,6 +51,7 @@ class DetailLogic extends BaseLogic
51 * @time :2024/11/13 9:30 51 * @time :2024/11/13 9:30
52 */ 52 */
53 public function saveDetail(){ 53 public function saveDetail(){
  54 + if(!empty($data)){
54 try { 55 try {
55 foreach ($this->param['data'] as $data){ 56 foreach ($this->param['data'] as $data){
56 foreach ($data as $v){ 57 foreach ($data as $v){
@@ -73,6 +74,7 @@ class DetailLogic extends BaseLogic @@ -73,6 +74,7 @@ class DetailLogic extends BaseLogic
73 }catch (\Exception $e){ 74 }catch (\Exception $e){
74 $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage()); 75 $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage());
75 } 76 }
  77 + }
76 return $this->success(['product_id'=>$this->param['product_id']]); 78 return $this->success(['product_id'=>$this->param['product_id']]);
77 } 79 }
78 } 80 }