From bf1940eb00a9c8bb24a54f9aca6860981b4f2a5d Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 8 Jun 2024 21:10:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E6=94=AF=E6=8C=81=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/user/UserController.php | 2 +- .../SystemStoreStorageController.php | 35 ++++++++ .../SystemStoreStorageLists.php | 82 +++++++++++++++++++ 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 app/store/controller/system_store_storage/SystemStoreStorageController.php create mode 100644 app/store/lists/system_store_storage/SystemStoreStorageLists.php diff --git a/app/api/controller/user/UserController.php b/app/api/controller/user/UserController.php index 6fffcc87..67c7efbd 100644 --- a/app/api/controller/user/UserController.php +++ b/app/api/controller/user/UserController.php @@ -87,7 +87,7 @@ class UserController extends BaseApiController $params['channel_type'] = $this->userInfo['terminal']; $order = UserLogic::recharge($params); $redirectUrl = $params['redirect'] ?? '/pages/payment/payment'; - $result = PaymentLogic::pay(PayEnum::WECHAT_PAY, 'recharge', $order, $this->userInfo['terminal'], $redirectUrl); + $result = PaymentLogic::pay(PayEnum::WECHAT_PAY_MINI, 'recharge', $order, $this->userInfo['terminal'], $redirectUrl); if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError(), $params); } diff --git a/app/store/controller/system_store_storage/SystemStoreStorageController.php b/app/store/controller/system_store_storage/SystemStoreStorageController.php new file mode 100644 index 00000000..ef3f1c0e --- /dev/null +++ b/app/store/controller/system_store_storage/SystemStoreStorageController.php @@ -0,0 +1,35 @@ +dataLists(new SystemStoreStorageLists()); + } + + + +} \ No newline at end of file diff --git a/app/store/lists/system_store_storage/SystemStoreStorageLists.php b/app/store/lists/system_store_storage/SystemStoreStorageLists.php new file mode 100644 index 00000000..e2e94148 --- /dev/null +++ b/app/store/lists/system_store_storage/SystemStoreStorageLists.php @@ -0,0 +1,82 @@ + ['admin_id', 'staff_id', 'status'], + ]; + } + + + /** + * @notes 获取门店入库记录列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/06/06 17:06 + */ + public function lists(): array + { + $this->searchWhere[] = ['store_id','=',$this->adminInfo['store_id']];//只显示当前门店的入库记录 + return SystemStoreStorage::where($this->searchWhere) + ->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums','mark', 'status']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function ($item) { + $item['system_store_name'] = SystemStore::where('id', $item['store_id'])->value('name'); + $item['admin_name'] = Admin::where('id', $item['admin_id'])->value('name'); + $item['admin_name'] = Admin::where('id', $item['admin_id'])->value('name'); + if ($item['staff_id'] > 0) { + $item['staff_name'] = SystemStoreStaff::where('id', $item['staff_id'])->value('staff_name'); + } else { + $item['staff_name'] = '无'; + } + $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image')->find(); + $item['store_name']=$find['store_name']; + $item['image']=$find['image']; + return $item; + }) + ->toArray(); + } + + + /** + * @notes 获取门店入库记录数量 + * @return int + * @author admin + * @date 2024/06/06 17:06 + */ + public function count(): int + { + return SystemStoreStorage::where($this->searchWhere)->count(); + } + +}