确认入账
This commit is contained in:
@@ -2,10 +2,12 @@
|
||||
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\logic\FinReceiptLogic;
|
||||
use app\common\model\FinReceiptHis;
|
||||
use app\common\validate\FinReceiptValidate;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\model\FinReceipt;
|
||||
use support\exception\BusinessException;
|
||||
use support\Request;
|
||||
|
||||
class FinReceiptService
|
||||
@@ -23,6 +25,14 @@ class FinReceiptService
|
||||
*/
|
||||
protected $validator = FinReceiptValidate::class;
|
||||
|
||||
|
||||
protected $logic;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->logic = (new FinReceiptLogic());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证器
|
||||
*/
|
||||
@@ -251,4 +261,13 @@ class FinReceiptService
|
||||
|
||||
return $query->paginate($limit, ['*'], 'page', $page);
|
||||
}
|
||||
|
||||
public function credit($id)
|
||||
{
|
||||
$finReceipt = FinReceipt::find($id);
|
||||
if(!empty($finReceipt->received_at)){
|
||||
throw new BusinessException('该记录已将确认入账');
|
||||
}
|
||||
return $this->logic->credit($id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user