diff --git a/app/admin/controller/store_extract/StoreExtractController.php b/app/admin/controller/store_extract/StoreExtractController.php new file mode 100644 index 000000000..855d4f55e --- /dev/null +++ b/app/admin/controller/store_extract/StoreExtractController.php @@ -0,0 +1,95 @@ +dataLists(new StoreExtractLists()); + } + + + /** + * @notes 添加门店提现 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function add() + { + $params = (new StoreExtractValidate())->post()->goCheck('add'); + $result = StoreExtractLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(StoreExtractLogic::getError()); + } + + + /** + * @notes 编辑门店提现 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function edit() + { + $params = (new StoreExtractValidate())->post()->goCheck('edit'); + $result = StoreExtractLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(StoreExtractLogic::getError()); + } + + + /** + * @notes 删除门店提现 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function delete() + { + $params = (new StoreExtractValidate())->post()->goCheck('delete'); + StoreExtractLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取门店提现详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 17:09 + */ + public function detail() + { + $params = (new StoreExtractValidate())->goCheck('detail'); + $result = StoreExtractLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/controller/store_finance_flow/StoreFinanceFlowController.php b/app/admin/controller/store_finance_flow/StoreFinanceFlowController.php new file mode 100644 index 000000000..f005e2e03 --- /dev/null +++ b/app/admin/controller/store_finance_flow/StoreFinanceFlowController.php @@ -0,0 +1,95 @@ +dataLists(new StoreFinanceFlowLists()); + } + + + /** + * @notes 添加门店流水 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function add() + { + $params = (new StoreFinanceFlowValidate())->post()->goCheck('add'); + $result = StoreFinanceFlowLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(StoreFinanceFlowLogic::getError()); + } + + + /** + * @notes 编辑门店流水 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function edit() + { + $params = (new StoreFinanceFlowValidate())->post()->goCheck('edit'); + $result = StoreFinanceFlowLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(StoreFinanceFlowLogic::getError()); + } + + + /** + * @notes 删除门店流水 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function delete() + { + $params = (new StoreFinanceFlowValidate())->post()->goCheck('delete'); + StoreFinanceFlowLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取门店流水详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:56 + */ + public function detail() + { + $params = (new StoreFinanceFlowValidate())->goCheck('detail'); + $result = StoreFinanceFlowLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/controller/user_bill/UserBillController.php b/app/admin/controller/user_bill/UserBillController.php new file mode 100644 index 000000000..c4cdb6dfc --- /dev/null +++ b/app/admin/controller/user_bill/UserBillController.php @@ -0,0 +1,95 @@ +dataLists(new UserBillLists()); + } + + + /** + * @notes 添加资金记录 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function add() + { + $params = (new UserBillValidate())->post()->goCheck('add'); + $result = UserBillLogic::add($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(UserBillLogic::getError()); + } + + + /** + * @notes 编辑资金记录 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function edit() + { + $params = (new UserBillValidate())->post()->goCheck('edit'); + $result = UserBillLogic::edit($params); + if (true === $result) { + return $this->success('编辑成功', [], 1, 1); + } + return $this->fail(UserBillLogic::getError()); + } + + + /** + * @notes 删除资金记录 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function delete() + { + $params = (new UserBillValidate())->post()->goCheck('delete'); + UserBillLogic::delete($params); + return $this->success('删除成功', [], 1, 1); + } + + + /** + * @notes 获取资金记录详情 + * @return \think\response\Json + * @author admin + * @date 2024/05/31 16:44 + */ + public function detail() + { + $params = (new UserBillValidate())->goCheck('detail'); + $result = UserBillLogic::detail($params); + return $this->data($result); + } + + +} \ No newline at end of file diff --git a/app/admin/lists/store_extract/StoreExtractLists.php b/app/admin/lists/store_extract/StoreExtractLists.php new file mode 100644 index 000000000..af2f4ac44 --- /dev/null +++ b/app/admin/lists/store_extract/StoreExtractLists.php @@ -0,0 +1,65 @@ + ['store_id', 'extract_type', 'status', 'pay_status', 'create_time'], + ]; + } + + + /** + * @notes 获取门店提现列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 17:09 + */ + public function lists(): array + { + return StoreExtract::where($this->searchWhere) + ->field(['id', 'store_id', 'extract_type', 'extract_price', 'mark', 'status', 'pay_status', 'admin_id', 'create_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店提现数量 + * @return int + * @author admin + * @date 2024/05/31 17:09 + */ + public function count(): int + { + return StoreExtract::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php b/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php new file mode 100644 index 000000000..00c75b096 --- /dev/null +++ b/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php @@ -0,0 +1,65 @@ + ['store_id', 'uid', 'create_time'], + ]; + } + + + /** + * @notes 获取门店流水列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 16:56 + */ + public function lists(): array + { + return StoreFinanceFlow::where($this->searchWhere) + ->field(['id', 'uid', 'staff_id', 'order_id', 'link_id', 'type', 'pay_type', 'remark', 'trade_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取门店流水数量 + * @return int + * @author admin + * @date 2024/05/31 16:56 + */ + public function count(): int + { + return StoreFinanceFlow::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/user_bill/UserBillLists.php b/app/admin/lists/user_bill/UserBillLists.php new file mode 100644 index 000000000..d7b22a3be --- /dev/null +++ b/app/admin/lists/user_bill/UserBillLists.php @@ -0,0 +1,65 @@ + ['uid', 'type', 'create_time'], + ]; + } + + + /** + * @notes 获取资金记录列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/05/31 16:44 + */ + public function lists(): array + { + return UserBill::where($this->searchWhere) + ->field(['id', 'type', 'number', 'mark', 'create_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select() + ->toArray(); + } + + + /** + * @notes 获取资金记录数量 + * @return int + * @author admin + * @date 2024/05/31 16:44 + */ + public function count(): int + { + return UserBill::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/logic/store_extract/StoreExtractLogic.php b/app/admin/logic/store_extract/StoreExtractLogic.php new file mode 100644 index 000000000..f11d97ccd --- /dev/null +++ b/app/admin/logic/store_extract/StoreExtractLogic.php @@ -0,0 +1,94 @@ +getMessage()); + return false; + } + } + + + /** + * @notes 编辑门店提现 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 17:09 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + StoreExtract::where('id', $params['id'])->update([ + + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除门店提现 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 17:09 + */ + public static function delete(array $params): bool + { + return StoreExtract::destroy($params['id']); + } + + + /** + * @notes 获取门店提现详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 17:09 + */ + public static function detail($params): array + { + return StoreExtract::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/logic/store_finance_flow/StoreFinanceFlowLogic.php b/app/admin/logic/store_finance_flow/StoreFinanceFlowLogic.php new file mode 100644 index 000000000..d4dec2553 --- /dev/null +++ b/app/admin/logic/store_finance_flow/StoreFinanceFlowLogic.php @@ -0,0 +1,94 @@ +getMessage()); + return false; + } + } + + + /** + * @notes 编辑门店流水 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:56 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + StoreFinanceFlow::where('id', $params['id'])->update([ + + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除门店流水 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:56 + */ + public static function delete(array $params): bool + { + return StoreFinanceFlow::destroy($params['id']); + } + + + /** + * @notes 获取门店流水详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 16:56 + */ + public static function detail($params): array + { + return StoreFinanceFlow::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/logic/store_product_unit/StoreProductUnitLogic.php b/app/admin/logic/store_product_unit/StoreProductUnitLogic.php index 9ec2c073d..9ea649ec1 100644 --- a/app/admin/logic/store_product_unit/StoreProductUnitLogic.php +++ b/app/admin/logic/store_product_unit/StoreProductUnitLogic.php @@ -34,7 +34,6 @@ class StoreProductUnitLogic extends BaseLogic 'py' => $params['py'], 'number' => $params['number'], 'data' => $params['data'], - 'more' => $params['more'] ]); Db::commit(); @@ -64,7 +63,6 @@ class StoreProductUnitLogic extends BaseLogic 'py' => $params['py'], 'number' => $params['number'], 'data' => $params['data'], - 'more' => $params['more'] ]); Db::commit(); diff --git a/app/admin/logic/user_bill/UserBillLogic.php b/app/admin/logic/user_bill/UserBillLogic.php new file mode 100644 index 000000000..f586146df --- /dev/null +++ b/app/admin/logic/user_bill/UserBillLogic.php @@ -0,0 +1,94 @@ +getMessage()); + return false; + } + } + + + /** + * @notes 编辑资金记录 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:44 + */ + public static function edit(array $params): bool + { + Db::startTrans(); + try { + UserBill::where('id', $params['id'])->update([ + + ]); + + Db::commit(); + return true; + } catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + } + + + /** + * @notes 删除资金记录 + * @param array $params + * @return bool + * @author admin + * @date 2024/05/31 16:44 + */ + public static function delete(array $params): bool + { + return UserBill::destroy($params['id']); + } + + + /** + * @notes 获取资金记录详情 + * @param $params + * @return array + * @author admin + * @date 2024/05/31 16:44 + */ + public static function detail($params): array + { + return UserBill::findOrEmpty($params['id'])->toArray(); + } +} \ No newline at end of file diff --git a/app/admin/validate/store_extract/StoreExtractValidate.php b/app/admin/validate/store_extract/StoreExtractValidate.php new file mode 100644 index 000000000..e9a9fc804 --- /dev/null +++ b/app/admin/validate/store_extract/StoreExtractValidate.php @@ -0,0 +1,82 @@ + 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + ]; + + + /** + * @notes 添加场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneAdd() + { + return $this->remove('id', true); + } + + + /** + * @notes 编辑场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneEdit() + { + return $this->only(['id']); + } + + + /** + * @notes 删除场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return StoreExtractValidate + * @author admin + * @date 2024/05/31 17:09 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/admin/validate/store_finance_flow/StoreFinanceFlowValidate.php b/app/admin/validate/store_finance_flow/StoreFinanceFlowValidate.php new file mode 100644 index 000000000..05a1abf42 --- /dev/null +++ b/app/admin/validate/store_finance_flow/StoreFinanceFlowValidate.php @@ -0,0 +1,82 @@ + 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + ]; + + + /** + * @notes 添加场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneAdd() + { + return $this->remove('id', true); + } + + + /** + * @notes 编辑场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneEdit() + { + return $this->only(['id']); + } + + + /** + * @notes 删除场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return StoreFinanceFlowValidate + * @author admin + * @date 2024/05/31 16:56 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/admin/validate/user_bill/UserBillValidate.php b/app/admin/validate/user_bill/UserBillValidate.php new file mode 100644 index 000000000..107ebaac1 --- /dev/null +++ b/app/admin/validate/user_bill/UserBillValidate.php @@ -0,0 +1,82 @@ + 'require', + ]; + + + /** + * 参数描述 + * @var string[] + */ + protected $field = [ + 'id' => 'id', + ]; + + + /** + * @notes 添加场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneAdd() + { + return $this->remove('id', true); + } + + + /** + * @notes 编辑场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneEdit() + { + return $this->only(['id']); + } + + + /** + * @notes 删除场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneDelete() + { + return $this->only(['id']); + } + + + /** + * @notes 详情场景 + * @return UserBillValidate + * @author admin + * @date 2024/05/31 16:44 + */ + public function sceneDetail() + { + return $this->only(['id']); + } + +} \ No newline at end of file diff --git a/app/common/model/store_extract/StoreExtract.php b/app/common/model/store_extract/StoreExtract.php new file mode 100644 index 000000000..c34325ef2 --- /dev/null +++ b/app/common/model/store_extract/StoreExtract.php @@ -0,0 +1,22 @@ +