multi-store/app/admin/controller/financial_transfers/FinancialTransfersController.php

129 lines
3.4 KiB
PHP

<?php
namespace app\admin\controller\financial_transfers;
use app\admin\controller\BaseAdminController;
use app\admin\lists\financial_transfers\FinancialTransfersLists;
use app\admin\logic\financial_transfers\FinancialTransfersLogic;
use app\admin\validate\financial_transfers\FinancialTransfersValidate;
/**
* 财务转账控制器
* Class FinancialTransfersController
* @package app\admin\controller\financial_transfers
*/
class FinancialTransfersController extends BaseAdminController
{
/**
* @notes 获取列表
* @return \think\response\Json
* @author admin
* @date 2024/06/14 10:10
*/
public function lists()
{
return $this->dataLists(new FinancialTransfersLists());
}
//确认
public function send_transfers()
{
$params = (new FinancialTransfersValidate())->post()->goCheck('send');
$result = FinancialTransfersLogic::dealsend($params);
if (true === $result) {
return $this->success('发送成功', [],1,1 );
}
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('转账成功',[],1,1);
}
return $this->fail(FinancialTransfersLogic::getError());
}
/**
* @notes 添加
* @return \think\response\Json
* @author admin
* @date 2024/06/14 10:10
*/
public function add()
{
$params = (new FinancialTransfersValidate())->post()->goCheck('add');
$result = FinancialTransfersLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(FinancialTransfersLogic::getError());
}
/**
* @notes 编辑
* @return \think\response\Json
* @author admin
* @date 2024/06/14 10:10
*/
public function edit()
{
$params = (new FinancialTransfersValidate())->post()->goCheck('edit');
$result = FinancialTransfersLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(FinancialTransfersLogic::getError());
}
/**
* @notes 删除
* @return \think\response\Json
* @author admin
* @date 2024/06/14 10:10
*/
public function delete()
{
$params = (new FinancialTransfersValidate())->post()->goCheck('delete');
FinancialTransfersLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @return \think\response\Json
* @author admin
* @date 2024/06/14 10:10
*/
public function detail()
{
$params = (new FinancialTransfersValidate())->goCheck('detail');
$result = FinancialTransfersLogic::detail($params);
return $this->data($result);
}
}