From 792b6ef647023fa2ffb63f2f112831f9a0ad2938 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 16:07:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/user/UserBill.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/controller/admin/user/UserBill.php b/app/controller/admin/user/UserBill.php index 040c4f77..57a341a4 100644 --- a/app/controller/admin/user/UserBill.php +++ b/app/controller/admin/user/UserBill.php @@ -54,17 +54,17 @@ class UserBill extends BaseController public function deposit(){ $where = $this->request->params(['keyword', 'date']); - // ->when(isset($where['date']) && $where['date'] !== '', function ($query) use ($where) { - // getModelTime($query, $where['date'], 'create_time'); - // }) - // ->when(isset($where['keyword']) && $where['keyword'] !== '', function ($query) use ($where) { - // $query->whereLike('a.uid|b.nickname|a.title', "%{$where['keyword']}%"); - // }) - // whereTime('birthday', 'between', ['1970-10-1', '2000-10-1']) - [$page, $limit] = $this->getPage(); $query= Db::name('margin_order')->where('paid',1); - // if(isset($where['date'])) + if(isset($where['date'])&& $where['date']!=''){ + $a=explode(' ',$where['date']); + $query->whereTime('birthday', 'between', [$a[0],$a[1]]); + } + if(isset($where['keyword'])&& $where['date']!=''){ + $a=Db::name('merchant')->whereLike('mer_name',$where['mer_name'])->column('mer_id'); + $query->where('mer_id', 'in', [$a[0],$a[1]]); + } + $count=$query->count(); $list=$query->withAttr('mer_name',function($value,$data){ return Db::name('merchant')->where('mer_id',$data['mer_id'])->value('mer_name'); @@ -73,6 +73,6 @@ class UserBill extends BaseController return Db::name('user')->where('uid',$data['uid'])->value('nickname'); }) ->page($page, $limit)->order('order_id', 'desc')->select()->toArray(); - return app('json')->success($list); + return app('json')->success(['count'=>$count,'list'=>$list]); } }