|
@@ -4,6 +4,7 @@ namespace app\admin\controller;
|
|
|
|
|
|
use app\common\controller\Backend;
|
|
|
use app\common\model\MobileOrderOperation;
|
|
|
+use app\common\service\Refund;
|
|
|
use think\Db;
|
|
|
|
|
|
/**
|
|
@@ -112,7 +113,7 @@ class MobileOrder extends Backend
|
|
|
}else{
|
|
|
$data=input('row/a');
|
|
|
$this->validate($data,[
|
|
|
- 'amount|金额'=>'require|integer|egt:0',
|
|
|
+ 'amount|金额'=>'require|number|egt:0',
|
|
|
]);
|
|
|
Db::startTrans();
|
|
|
$model=$this->model->where('id',$ids)->lock(true)->findOrFail();
|
|
@@ -120,6 +121,8 @@ class MobileOrder extends Backend
|
|
|
$this->error('退款金额不能大于付款金额');
|
|
|
}
|
|
|
$model['amount_refund']=$data['amount'];
|
|
|
+ $model['refund_no']=session_create_id();
|
|
|
+ Refund::setType($model)->refund();
|
|
|
$model->save();
|
|
|
|
|
|
Db::commit();
|