diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index 9c8c22fb0..c4368e496 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -55,7 +55,7 @@ class StoreController extends BaseApiController 'staff_id'=>0, 'order_id'=>getNewOrderId('CZ'), 'price'=>0.01, - 'recharge_type'=>'wechat_mini' + 'recharge_type'=>'INDUSTRYMEMBERS', ]; $order = UserRecharge::create($data); @@ -72,4 +72,18 @@ class StoreController extends BaseApiController } return $this->success('支付成功', ['out_trade_no' => $result['out_trade_no'], 'pay_type' => PayEnum::WECHAT_PAY_BARCODE, 'transaction_id' => $result['transaction_id']]); } + + /** + * 门店会员充值数量 + */ + public function recharge_count() + { + $store_id = $this->request->get('store_id',0); + $count=0; + if($store_id){ + $count= UserRecharge::where(['store_id'=>$store_id,'recharge_type'=>'INDUSTRYMEMBERS','paid'=>1])->count(); + } + return $this->success('ok',['count'=>$count]); + + } } diff --git a/app/api/controller/user/UserRechargeController.php b/app/api/controller/user/UserRechargeController.php new file mode 100644 index 000000000..6ca86becf --- /dev/null +++ b/app/api/controller/user/UserRechargeController.php @@ -0,0 +1,24 @@ +dataLists(new UserFeedbackLists()); + } + } diff --git a/app/api/lists/user/UserRechargeLists.php b/app/api/lists/user/UserRechargeLists.php new file mode 100644 index 000000000..482cf821c --- /dev/null +++ b/app/api/lists/user/UserRechargeLists.php @@ -0,0 +1,63 @@ + ['store_id','recharge_type'], + ]; + } + + + /** + * @notes 获取用户充值表列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author likeadmin + * @date 2024/05/13 16:56 + */ + public function lists(): array + { + return UserRecharge::where($this->searchWhere) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($data){ + $user = User::field('nickname')->where('id',$data['uid'])->findOrEmpty(); + $data['user_name'] = !$user->isEmpty() ? $user['nickname'] : ''; + }) + ->toArray(); + } + + + /** + * @notes 获取用户充值表数量 + * @return int + * @author likeadmin + * @date 2024/05/13 16:56 + */ + public function count(): int + { + return UserFeedback::where($this->searchWhere)->count(); + } + + } \ No newline at end of file diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index 70eba2f91..de727787f 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -350,6 +350,7 @@ class StoreOrderController extends BaseAdminController 'staff_id'=>$this->adminId, 'order_id'=>getNewOrderId('CZ'), 'price'=>$params['price'], + 'recharge_type'=>'INDUSTRYMEMBERS', ]; $order = UserRecharge::create($data); $order['pay_price']=$order['price'];