diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index a620c3d2..c4368e49 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -55,6 +55,7 @@ class StoreController extends BaseApiController 'staff_id'=>0, 'order_id'=>getNewOrderId('CZ'), 'price'=>0.01, + 'recharge_type'=>'INDUSTRYMEMBERS', ]; $order = UserRecharge::create($data); @@ -71,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 00000000..6ca86bec --- /dev/null +++ b/app/api/controller/user/UserRechargeController.php @@ -0,0 +1,24 @@ +dataLists(new UserFeedbackLists()); + } + } diff --git a/app/api/lists/product/ProductLists.php b/app/api/lists/product/ProductLists.php index a11a486c..438a317e 100644 --- a/app/api/lists/product/ProductLists.php +++ b/app/api/lists/product/ProductLists.php @@ -113,7 +113,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface,Li if($M_store_id){ $where[]=['store_id','=',$M_store_id]; $data = StoreBranchProduct::where($this->searchWhere)->where($where) - ->field(['id', 'product_id','cate_id','store_name', 'cost','store_id','price', 'bar_code','image','sales','store_info','delete_time','unit']) + ->field(['id', 'product_id','cate_id','store_name','batch', 'cost','store_id','price', 'bar_code','image','sales','store_info','delete_time','unit']) ->limit($this->limitOffset, $this->limitLength) ->with(['className','unitName']) ->order($this->sortOrder) @@ -122,7 +122,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface,Li }else{ $data = StoreBranchProduct::where($this->searchWhere)->where($where) - ->field(['id', 'product_id','cate_id','store_name','cost', 'store_id','price', 'bar_code','image','sales','store_info','delete_time','unit']) + ->field(['id', 'product_id','cate_id','store_name','batch','cost', 'store_id','price', 'bar_code','image','sales','store_info','delete_time','unit']) ->limit($this->limitOffset, $this->limitLength) ->with(['className','unitName']) ->order($this->sortOrder) diff --git a/app/api/lists/user/UserRechargeLists.php b/app/api/lists/user/UserRechargeLists.php new file mode 100644 index 00000000..482cf821 --- /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 70eba2f9..de727787 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'];