店铺提现列表,后台设置商户的提现银行相关信息
This commit is contained in:
parent
83f03f126d
commit
a21727f09b
@ -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){
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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();
|
||||
|
@ -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 添加场景
|
||||
|
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace app\store\controller\finance;
|
||||
|
||||
|
||||
use app\admin\lists\financial_transfers\FinancialTransfersLists;
|
||||
use app\admin\logic\financial_transfers\FinancialTransfersLogic;
|
||||
use app\admin\validate\financial_transfers\FinancialTransfersValidate;
|
||||
use app\common\controller\Definitions;
|
||||
use app\store\controller\BaseAdminController;
|
||||
use hg\apidoc\annotation as ApiDoc;
|
||||
|
||||
#[ApiDoc\title('提现列表')]
|
||||
class FinancialTransfersController extends BaseAdminController
|
||||
{
|
||||
// public $notNeedLogin = ['confirmation', 'app_update', 'test'];
|
||||
#[
|
||||
ApiDoc\Title('财务流水'),
|
||||
ApiDoc\url('/store/finance/financialTransfers/lists'),
|
||||
ApiDoc\Method('GET'),
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Query(name: 'status', type: 'int', require: true, desc: '状态1'),
|
||||
ApiDoc\Query(name: 'store_id', type: 'int', require: true, desc: '店员id'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Query(ref: [Definitions::class, "page"]),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
]
|
||||
public function lists()
|
||||
{
|
||||
return $this->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());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user