dyjh před 6 roky
rodič
revize
991049190f

+ 1 - 1
app/Http/Controllers/Api/V1/AlbumBossController.php

xqd
@@ -691,7 +691,7 @@ class AlbumBossController extends Controller
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $store_id = $request->input('store_id');
-        $agent = AlbumAgentModel::where('store_id', $store_id)->orderByDesc('newCount')->select('realname', 'pointCount', 'callCount', 'favoriteCount', 'get_count', 'share_times', 'newCount')->pagenate(12);
+        $agent = AlbumAgentModel::where('store_id', $store_id)->orderByDesc('newCount')->select('realname', 'pointCount', 'callCount', 'favoriteCount', 'get_count', 'share_times', 'newCount')->paginate(12);
         return $this->api($agent);
     }
 }

+ 19 - 15
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd
@@ -758,24 +758,26 @@ class AlbumController extends Controller
                     continue;
                 }
                 $cat = AlbumCatModel::find($goods->cat_id);
-                if(empty($cat)) continue;
-                $action = '点击了您的'.$cat->name.'分类下的商品 '.$goods->name.'的'.$goods_data['detail'];
-            }elseif($val->action==6){
-                $detail = json_decode($val->detail,true);
+                if (empty($cat)) {
+                    continue;
+                }
+                $action = '点击了您的' . $cat->name . '分类下的商品 ' . $goods->name . '的' . $goods_data['detail'];
+            } elseif ($val->action == 6) {
+                $detail = json_decode($val->detail, true);
                 $address = $detail['detail'];
-                $action = '查看了您的地址'.$address.',并且点击了导航';
-            }elseif($val->action==7){
-                $detail = json_decode($val->detail,true);
+                $action = '查看了您的地址' . $address . ',并且点击了导航';
+            } elseif ($val->action == 7) {
+                $detail = json_decode($val->detail, true);
                 $phone = $detail['detail'];
-                $action = '查看了您的电话'.$phone.',并且点击了拨号';
+                $action = '查看了您的电话' . $phone . ',并且点击了拨号';
             }
-
-            $user = AlbumUserModel::where([['open_id',$val->open_id],['store_id',$val->store_id]])->select(['username','avatar','phone'])->first();
-            // dd(111);
+            $user = AlbumUserModel::where([
+                ['open_id',$val->open_id],['store_id',$val->store_id]
+            ])->select(['username','avatar','phone'])->first();
             $data_res[] = [
-                'time'=>$val->created_at,
-                'action'=>$action,
-                'user'=>$user
+                'time'   => $val->created_at,
+                'action' => $action,
+                'user'   => $user
             ];
         }
         return $this->api(compact('data_res'));
@@ -896,7 +898,9 @@ class AlbumController extends Controller
     public function albumGetDataCat(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'parent_id' => 'required'