소스 검색

Update api

dyjh 6 년 전
부모
커밋
1fab21a382
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      app/Http/Controllers/Api/V1/AlbumController.php

+ 3 - 0
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd
@@ -700,6 +700,8 @@ class AlbumController extends Controller
         if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
         $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
         $res = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id]])->get();
+        $count = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id]])->groupBy('wechat_open_id')->count();
+        dd($count);
         $action = '';
         foreach($res as $key=>$val){
             if($val->action==4){
@@ -735,6 +737,7 @@ class AlbumController extends Controller
             }
             $user = AlbumUserModel::where([['wechat_open_id',$val->open_id],['store_id',$val->store_id]])->select(['username','avatar','phone'])->first();
             $data_res[] = [
+                'type'=>$val->action,
                 'time'=>$val->created_at,
                 'action'=>$action,
                 'user'=>$user