| xqd
@@ -2244,13 +2244,13 @@ class AlbumController extends Controller
|
|
|
}
|
|
|
$res = AlbumFavoriteModel::whereIn('user_id',$users)->where([['store_id',$store_id]])->groupBy('product_id')->get(['product_id'])->toArray();
|
|
|
foreach($res as $key=>$val){
|
|
|
- $goods = AlbumProductModel::where([['id',$val['product_id']],['store_id',$store_id]])->get();
|
|
|
+ $goods = AlbumProductModel::where([['id',$val['product_id']],['store_id',$store_id]])->first();
|
|
|
if(!$goods){
|
|
|
unset($res[$key]);continue;
|
|
|
}
|
|
|
|
|
|
$res[$key]['name'] = $goods->name;
|
|
|
- dd($res);
|
|
|
+ // dd($res);
|
|
|
$res[$key]['count'] = AlbumFavoriteModel::whereIn('user_id',$users)->where([['store_id',$store_id],['product_id',$val['product_id']]])->count();
|
|
|
}
|
|
|
return $this->api($res,0,'success');
|