13283339616 преди 6 години
родител
ревизия
c4f5164bbc
променени са 2 файла, в които са добавени 4 реда и са изтрити 6 реда
  1. 4 5
      app/Api/V1/Controllers/FeaturesController.php
  2. 0 1
      app/Api/V1/Controllers/FindsController.php

+ 4 - 5
app/Api/V1/Controllers/FeaturesController.php

@@ -345,6 +345,8 @@ class FeaturesController extends BaseController
345 345
         if(!$this->startsWith($menu['url'],'http') && $menu['url'] !='None' && $menu['url']!=''){
346 346
             $menu['url']=config('constants.HOST_URL').$menu['url'];
347 347
         }
348
+        $menu=json_decode(json_encode($menu),true);
349
+        $menu['tags']=trim($menu['tags']);
348 350
         $initArr=array();
349 351
         $initArr[]=$id;
350 352
         $readArr=Menu::getReadNum($initArr);
@@ -361,10 +363,7 @@ class FeaturesController extends BaseController
361 363
         }
362 364
         $init=array();
363 365
         $list=explode(';',$menu['ingredients']);
364
-        foreach($list as $item){
365
-            $origin=explode(',',$item);
366
-            $init[$origin[0]]=$origin[1];
367
-        }
366
+        $init=Menu::formatStr($list);
368 367
         $menu['ingredients']=$init;
369 368
         $token   = $request->headers->get('token');
370 369
         if($token==''){
@@ -386,7 +385,7 @@ class FeaturesController extends BaseController
386 385
                 }
387 386
             }
388 387
         }
389
-        $menuDetail=DB::table('menu_step')->where('menu_id',$id)->get();
388
+        $menuDetail=DB::table('menu_step')->select('step','url')->where('menu_id',$id)->get();
390 389
         $menuDetail=json_decode(json_encode($menuDetail),true);
391 390
         foreach($menuDetail as $key=>$value){
392 391
             if(!$this->startsWith($value['url'],'http')  && $value['url'] !='None' && $value['url']!=''){

+ 0 - 1
app/Api/V1/Controllers/FindsController.php

@@ -33,7 +33,6 @@ class FindsController extends BaseController
33 33
                 }
34 34
             }else{
35 35
                 $user_id = Menu::getUserId($token);
36
-                //查询是否收藏过该商品  收藏过 - 取消收藏 ; 未收藏 - 进行收藏操作
37 36
                 $userArr=DB::table('users')->where('user_id',$user_id)->pluck('user_id');
38 37
                 $userArr=json_decode(json_encode($userArr),true);
39 38
                 $findArr=DB::table('users')->where('user_id',$user_id)->pluck('vest_publish_id');