From 1b35abd03d15f74d6e0739ce22bbbce1364c2e45 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 12:46:32 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 3df17140..336a67b4 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -285,11 +285,11 @@ class Auth extends BaseController if($merchant['margin'] == 0){ $margin = Db::name('MerchantType')->where('mer_type_id', $merchant['type_id'])->value('margin'); $margin = bcsub($margin,$merchant['paid_margin'],2); - if($margin==0){ - return app('json')->fail('当前金额为0,不能进行充值'); - } }else{ - $margin=0; + $margin=$merchant['margin']; + } + if($margin==0){ + return app('json')->fail('当前金额为0,不能进行充值'); } $orderSn = "bzj" . date('YmdHis') . uniqid(); Db::name('margin_order')->insert([ From 6289d2a6cda356df5dd5fb49e6e5010d0cdff3fc Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 15:23:44 +0800 Subject: [PATCH 2/7] =?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 | 25 +++++++++++++++++++++++++ route/admin/accounts.php | 3 +++ 2 files changed, 28 insertions(+) diff --git a/app/controller/admin/user/UserBill.php b/app/controller/admin/user/UserBill.php index 1e63e5a5..040c4f77 100644 --- a/app/controller/admin/user/UserBill.php +++ b/app/controller/admin/user/UserBill.php @@ -19,6 +19,7 @@ use crmeb\basic\BaseController; use app\common\repositories\user\UserBillRepository; use crmeb\services\ExcelService; use think\App; +use think\facade\Db; class UserBill extends BaseController { @@ -50,4 +51,28 @@ class UserBill extends BaseController $data = app()->make(ExcelService::class)->bill($where,$page,$limit); return app('json')->success($data); } + + 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'])) + + $list=$query->withAttr('mer_name',function($value,$data){ + return Db::name('merchant')->where('mer_id',$data['mer_id'])->value('mer_name'); + }) + ->withAttr('nickname',function($value,$data){ + return Db::name('user')->where('uid',$data['uid'])->value('nickname'); + }) + ->page($page, $limit)->order('order_id', 'desc')->select()->toArray(); + return app('json')->success($list); + } } diff --git a/route/admin/accounts.php b/route/admin/accounts.php index f5c4c0ec..6da6e1bb 100644 --- a/route/admin/accounts.php +++ b/route/admin/accounts.php @@ -148,6 +148,9 @@ Route::group(function () { //余额变动记录 Route::group('bill', function () { + Route::get('deposit', 'UserBill/deposit')->name('systemUserBillDeposit')->option([ + '_alias' => '押金列表', + ]); Route::get('list', 'UserBill/getList')->name('systemUserBillList')->option([ '_alias' => '列表', ]); 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 3/7] =?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]); } } From ef513bba6e9d37d1fb78ad252f175aba55b7b03c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 16:09:31 +0800 Subject: [PATCH 4/7] =?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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controller/admin/user/UserBill.php b/app/controller/admin/user/UserBill.php index 57a341a4..5f672d1d 100644 --- a/app/controller/admin/user/UserBill.php +++ b/app/controller/admin/user/UserBill.php @@ -53,17 +53,20 @@ class UserBill extends BaseController } public function deposit(){ - $where = $this->request->params(['keyword', 'date']); + $where = $this->request->params(['keyword', 'date','mer_id']); [$page, $limit] = $this->getPage(); $query= Db::name('margin_order')->where('paid',1); if(isset($where['date'])&& $where['date']!=''){ $a=explode(' ',$where['date']); $query->whereTime('birthday', 'between', [$a[0],$a[1]]); } - if(isset($where['keyword'])&& $where['date']!=''){ + if(isset($where['keyword'])&& $where['keyword']!=''){ $a=Db::name('merchant')->whereLike('mer_name',$where['mer_name'])->column('mer_id'); $query->where('mer_id', 'in', [$a[0],$a[1]]); } + if(isset($where['mer_id'])&& $where['mer_id']!=''){ + $query->where('mer_id', $where['mer_id']); + } $count=$query->count(); $list=$query->withAttr('mer_name',function($value,$data){ From 182ccfce5667dc48756ed38dc06ae85bda6cb52a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 16:45:55 +0800 Subject: [PATCH 5/7] =?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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controller/admin/user/UserBill.php b/app/controller/admin/user/UserBill.php index 5f672d1d..850e3b3d 100644 --- a/app/controller/admin/user/UserBill.php +++ b/app/controller/admin/user/UserBill.php @@ -58,15 +58,17 @@ class UserBill extends BaseController $query= Db::name('margin_order')->where('paid',1); if(isset($where['date'])&& $where['date']!=''){ $a=explode(' ',$where['date']); - $query->whereTime('birthday', 'between', [$a[0],$a[1]]); + $query->whereTime('create_time', 'between', [$a[0],$a[1]]); } if(isset($where['keyword'])&& $where['keyword']!=''){ $a=Db::name('merchant')->whereLike('mer_name',$where['mer_name'])->column('mer_id'); $query->where('mer_id', 'in', [$a[0],$a[1]]); } + if(isset($where['mer_id'])&& $where['mer_id']!=''){ $query->where('mer_id', $where['mer_id']); } + $count=$query->count(); $list=$query->withAttr('mer_name',function($value,$data){ From 3cdc6a808481ba8c28b2288804db285035a6fe84 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 16:58:51 +0800 Subject: [PATCH 6/7] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controller/admin/user/UserBill.php b/app/controller/admin/user/UserBill.php index 850e3b3d..78eb12a4 100644 --- a/app/controller/admin/user/UserBill.php +++ b/app/controller/admin/user/UserBill.php @@ -61,7 +61,7 @@ class UserBill extends BaseController $query->whereTime('create_time', 'between', [$a[0],$a[1]]); } if(isset($where['keyword'])&& $where['keyword']!=''){ - $a=Db::name('merchant')->whereLike('mer_name',$where['mer_name'])->column('mer_id'); + $a=Db::name('merchant')->whereLike('mer_name',$where['keyword'])->column('mer_id'); $query->where('mer_id', 'in', [$a[0],$a[1]]); } From d50c251e481b3cc209797f726e7d7061ece9cc56 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 8 Oct 2023 17:01:03 +0800 Subject: [PATCH 7/7] =?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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controller/admin/user/UserBill.php b/app/controller/admin/user/UserBill.php index 78eb12a4..2ee77f64 100644 --- a/app/controller/admin/user/UserBill.php +++ b/app/controller/admin/user/UserBill.php @@ -61,8 +61,10 @@ class UserBill extends BaseController $query->whereTime('create_time', 'between', [$a[0],$a[1]]); } if(isset($where['keyword'])&& $where['keyword']!=''){ - $a=Db::name('merchant')->whereLike('mer_name',$where['keyword'])->column('mer_id'); - $query->where('mer_id', 'in', [$a[0],$a[1]]); + $a=Db::name('merchant')->whereLike('mer_name','%'.$where['keyword'].'%')->column('mer_id'); + if($a){ + $query->where('mer_id', 'in', $a); + } } if(isset($where['mer_id'])&& $where['mer_id']!=''){