财务上传凭证相关

This commit is contained in:
liu 2024-06-14 15:34:50 +08:00
parent a21727f09b
commit 3bbf947674
5 changed files with 38 additions and 7 deletions

View File

@ -29,18 +29,43 @@ class FinancialTransfersController extends BaseAdminController
return $this->dataLists(new FinancialTransfersLists()); return $this->dataLists(new FinancialTransfersLists());
} }
//确认
public function send_transfers() public function send_transfers()
{ {
$params = (new FinancialTransfersValidate())->post()->goCheck('send'); $params = (new FinancialTransfersValidate())->post()->goCheck('send');
$result = FinancialTransfersLogic::dealsend($params); $result = FinancialTransfersLogic::dealsend($params);
if (true === $result) { if (true === $result) {
return $this->success('发送成功', [], ); return $this->success('发送成功', [],1,1 );
} }
return $this->fail(FinancialTransfersLogic::getError()); return $this->fail(FinancialTransfersLogic::getError());
} }
//财务上传凭证
public function success_send()
{
$params = (new FinancialTransfersValidate())->post()->goCheck('success');
$update = [
'transfer_picture'=>$params['transfer_picture']
];
$update['status'] = -1;
if($params['status']){
$update['status'] = 3;
$update['pay_status'] = 1;
}
$update['fail_msg'] = $params['fail_msg']??'';
$result = FinancialTransfersLogic::dealchange($update,$params['id']);
if (true === $result) {
return $this->success('转账成功' );
}
return $this->fail(FinancialTransfersLogic::getError());
}

View File

@ -132,9 +132,8 @@ class FinancialTransfersLogic extends BaseLogic
} }
public static function storeConfirmation($params,$id) public static function dealchange($params,$id)
{ {
Db::startTrans(); Db::startTrans();
try { try {
FinancialTransfers::where('id',$id) FinancialTransfers::where('id',$id)

View File

@ -23,6 +23,7 @@ class FinancialTransfersValidate extends BaseValidate
'store_id' => 'require', 'store_id' => 'require',
'money' => 'require', 'money' => 'require',
'status' => 'require|number', 'status' => 'require|number',
'transfer_picture' => 'require',
]; ];
@ -35,6 +36,7 @@ class FinancialTransfersValidate extends BaseValidate
'store_id' => '店铺id', 'store_id' => '店铺id',
'money' => '金额', 'money' => '金额',
'status' => '状态', 'status' => '状态',
'transfer_picture' => '财务上传凭证',
]; ];
@ -49,6 +51,11 @@ class FinancialTransfersValidate extends BaseValidate
return $this->only(['id','status']); return $this->only(['id','status']);
} }
public function sceneSuccess()
{
return $this->only(['id','transfer_picture','status']);
}
/** /**

View File

@ -25,7 +25,7 @@ class FinancialTransfers extends BaseModel
public function store() public function store()
{ {
return $this->hasOne(SystemStore::class, 'id','store_id') return $this->hasOne(SystemStore::class, 'id','store_id')
->bind(['store_name'=>'name', 'store_phone'=>'phone','store_detailed_address'=>'detailed_address','store_simple_address'=>'address']); ->bind(['store_name'=>'name', 'store_phone'=>'phone','store_detailed_address'=>'detailed_address','store_simple_address'=>'address','store_bank'=>'bank','store_bank_code'=>'bank_code','store_bank_address'=>'bank_address','store_realName'=>'realname']);
} }

View File

@ -60,7 +60,7 @@ class FinancialTransfersController extends BaseAdminController
$data['confirmation_time'] = time(); $data['confirmation_time'] = time();
} }
$data['status'] = $status; $data['status'] = $status;
$result = FinancialTransfersLogic::storeConfirmation($data,$params['id']); $result = FinancialTransfersLogic::dealchange($data,$params['id']);
if (true === $result) { if (true === $result) {
return $this->success('操作成功' ); return $this->success('操作成功' );