| xqd
@@ -941,18 +941,25 @@ class AlbumController extends Controller
|
|
|
if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
|
|
|
$validator = Validator::make($request->all(), [
|
|
|
'store_id' => 'required',
|
|
|
+ 'end' => 'required',
|
|
|
+ 'start' => 'required',
|
|
|
],[
|
|
|
'store_id.required'=>'缺少商户参数',
|
|
|
+ 'end.required'=>'缺少结束时间参数',
|
|
|
+ 'start.required'=>'缺少开始时间参数',
|
|
|
]);
|
|
|
if ($validator->fails()) {
|
|
|
return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
|
|
|
}
|
|
|
$store_id = $request->input('store_id');
|
|
|
-
|
|
|
+ $end = $request->input('end');
|
|
|
+ $start = $request->input('start');
|
|
|
+ $end= date('Y-m-d H:i:s',$end);
|
|
|
+ $start= date('Y-m-d H:i:s',$start);
|
|
|
if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
|
|
|
// if($userAuth->up_agent_id==0) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未选择经销商!', $validator->messages());
|
|
|
$user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
|
|
|
- $count_user = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id]])->groupBy('open_id')->get();
|
|
|
+ $count_user = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id],['updated_at','>=',$start],['updated_at','<=',$end]])->groupBy('open_id')->get();
|
|
|
|
|
|
$users = Array();
|
|
|
if($count_user){
|