13283339616 6 years ago
parent
commit
c4f5164bbc

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

345
         if(!$this->startsWith($menu['url'],'http') && $menu['url'] !='None' && $menu['url']!=''){
345
         if(!$this->startsWith($menu['url'],'http') && $menu['url'] !='None' && $menu['url']!=''){
346
             $menu['url']=config('constants.HOST_URL').$menu['url'];
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
         $initArr=array();
350
         $initArr=array();
349
         $initArr[]=$id;
351
         $initArr[]=$id;
350
         $readArr=Menu::getReadNum($initArr);
352
         $readArr=Menu::getReadNum($initArr);
361
         }
363
         }
362
         $init=array();
364
         $init=array();
363
         $list=explode(';',$menu['ingredients']);
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
         $menu['ingredients']=$init;
367
         $menu['ingredients']=$init;
369
         $token   = $request->headers->get('token');
368
         $token   = $request->headers->get('token');
370
         if($token==''){
369
         if($token==''){
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
         $menuDetail=json_decode(json_encode($menuDetail),true);
389
         $menuDetail=json_decode(json_encode($menuDetail),true);
391
         foreach($menuDetail as $key=>$value){
390
         foreach($menuDetail as $key=>$value){
392
             if(!$this->startsWith($value['url'],'http')  && $value['url'] !='None' && $value['url']!=''){
391
             if(!$this->startsWith($value['url'],'http')  && $value['url'] !='None' && $value['url']!=''){

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

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