diff --git a/app/admin/lists/system_store/SystemStoreLists.php b/app/admin/lists/system_store/SystemStoreLists.php index 40b3804e..d961fcce 100644 --- a/app/admin/lists/system_store/SystemStoreLists.php +++ b/app/admin/lists/system_store/SystemStoreLists.php @@ -44,7 +44,9 @@ class SystemStoreLists extends BaseAdminDataLists implements ListsSearchInterfac public function lists(): array { return SystemStore::where($this->searchWhere) - ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show','day_start','day_end']) + ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show','day_start','day_end' + ,'bank','bank_code','bank_address','realname' + ]) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item){ diff --git a/app/admin/logic/financial_transfers/FinancialTransfersLogic.php b/app/admin/logic/financial_transfers/FinancialTransfersLogic.php index 05626665..4f48f25a 100644 --- a/app/admin/logic/financial_transfers/FinancialTransfersLogic.php +++ b/app/admin/logic/financial_transfers/FinancialTransfersLogic.php @@ -130,6 +130,28 @@ class FinancialTransfersLogic extends BaseLogic } + + + public static function storeConfirmation($params,$id) + { + + Db::startTrans(); + try { + FinancialTransfers::where('id',$id) + ->update( + $params + ); + + Db::commit(); + return true; + }catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + + + } } \ No newline at end of file diff --git a/app/admin/logic/system_store/SystemStoreLogic.php b/app/admin/logic/system_store/SystemStoreLogic.php index 85324743..695ea00b 100644 --- a/app/admin/logic/system_store/SystemStoreLogic.php +++ b/app/admin/logic/system_store/SystemStoreLogic.php @@ -45,6 +45,10 @@ class SystemStoreLogic extends BaseLogic 'province' => $params['province_code'], 'city' => $params['city_code'], 'area' => $params['area_code'], + 'bank' => $params['bank']??'', + 'bank_code' => $params['bank_code']??'', + 'bank_address' => $params['bank_address']??'', + 'realname' => $params['realname']??'', 'street' => $params['street_code'], 'is_store' => $params['is_store'] ?? 0, 'is_send' => $params['is_send'] ?? 0, @@ -102,6 +106,10 @@ class SystemStoreLogic extends BaseLogic 'day_time' => $params['day_time'] ?? 0, 'is_store' => $params['is_store'] ?? 0, 'is_send' => $params['is_send'] ?? 0, + 'bank' => $params['bank']??'', + 'bank_code' => $params['bank_code']??'', + 'bank_address' => $params['bank_address']??'', + 'realname' => $params['realname']??'', 'default_delivery' => $params['default_delivery'] ?? 2, ]); $res=SystemStoreStaff::where('store_id', $params['id'])->where('is_admin', 1)->where('account', $params['phone'])->find(); diff --git a/app/admin/validate/financial_transfers/FinancialTransfersValidate.php b/app/admin/validate/financial_transfers/FinancialTransfersValidate.php index f655002f..fa828664 100644 --- a/app/admin/validate/financial_transfers/FinancialTransfersValidate.php +++ b/app/admin/validate/financial_transfers/FinancialTransfersValidate.php @@ -22,6 +22,7 @@ class FinancialTransfersValidate extends BaseValidate 'id' => 'require', 'store_id' => 'require', 'money' => 'require', + 'status' => 'require|number', ]; @@ -33,6 +34,7 @@ class FinancialTransfersValidate extends BaseValidate 'id' => 'id', 'store_id' => '店铺id', 'money' => '金额', + 'status' => '状态', ]; @@ -42,6 +44,12 @@ class FinancialTransfersValidate extends BaseValidate } + public function sceneConfirm() + { + return $this->only(['id','status']); + } + + /** * @notes 添加场景 diff --git a/app/store/controller/finance/FinancialTransfersController.php b/app/store/controller/finance/FinancialTransfersController.php new file mode 100644 index 00000000..5278a430 --- /dev/null +++ b/app/store/controller/finance/FinancialTransfersController.php @@ -0,0 +1,75 @@ +dataLists(new FinancialTransfersLists()); + } + + + #[ + ApiDoc\Title('店铺确认'), + ApiDoc\url('/store/finance/financialTransfers/confirmation'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\Author('中国队长'), + ApiDoc\Query(name: 'status', type: 'int', require: true, desc: '状态1确认 0不确认'), + ApiDoc\Query(name: 'id', type: 'int', require: true, desc: '数据id'), + ApiDoc\Query(name: 'mark', type: 'string', require: false, desc: '原因/备注'), + ApiDoc\Header(ref: [Definitions::class, "token"]), + ApiDoc\Query(ref: [Definitions::class, "page"]), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function confirmation() + { + $params = (new FinancialTransfersValidate())->post()->goCheck('confirm'); + + $staff_id = $this->request->adminInfo['admin_id']??5; + $data = [ + 'store_staff_id' => $staff_id, + 'mark' => $params['mark']??'', + ]; + $status = -2; + if ($params['status']) { + $status = 2; + $data['confirmation_time'] = time(); + } + $data['status'] = $status; + $result = FinancialTransfersLogic::storeConfirmation($data,$params['id']); + + if (true === $result) { + return $this->success('操作成功' ); + } + return $this->fail(FinancialTransfersLogic::getError()); + + + + } + + +} \ No newline at end of file