wugg hace 5 meses
padre
commit
898ccc6056
Se han modificado 2 ficheros con 6 adiciones y 5 borrados
  1. 5 4
      app/cxinv/controller/Stage.php
  2. 1 1
      app/provider.php

+ 5 - 4
app/cxinv/controller/Stage.php

@@ -40,6 +40,7 @@ class Stage extends Base{
         foreach ($params["cgdNos"] as $v){
             if(!$val->check($v)) return error($val->getError());
             if(!in_array($v["sequenceNo"],$cgdNos)) return error("{$v["sequenceNo"]}采购单号不在当前对账单中");
+            if($v["rela_fee"]<=0) continue;
             $relaData[]=[
                 "dzNo"=>$dzNo,
                 "payNo"=>$params["payNo"],
@@ -142,8 +143,8 @@ class Stage extends Base{
             "dzNo|付款申请编号"=>"require|max:255",
             "status|审核状态"=>"require|number|in:1,2,3,4,5,6,7",
             "remark|备注"=>"max:255",
-            "return_image|回执图片"=>"requireIf:status=4|max:255",
-            "return_time|回执时间"=>"requireIf:status=4|date"
+            "return_image|回执图片"=>"requireIf:status,4|max:255",
+            "return_time|回执时间"=>"requireIf:status,4|date"
         ]);
         if(!$valid->check($params)) return error($valid->getError());
         $stage = $this->model->where([['dzNo','=',$params['dzNo']],['is_del','=',0]])->findOrEmpty();
@@ -153,7 +154,7 @@ class Stage extends Base{
         if($pay->status!=2) return error("对账单状态不正确");
         if($pay->pay_fee<$stage['pay_fee']) return error("对账付款申请金额有误,请确认对账申请金额");
         $this->model->startTrans();
-        try{
+       try{
             $stage->status=$params['status'];
             $stage->remark=$params['remark'];
             if($params['status']==4){
@@ -163,7 +164,7 @@ class Stage extends Base{
 
             $stageSte=$stage->save();
             if(!$stageSte) throw new \Exception("更新付款申请状态失败");
-            $this->model->commit();
+            $this->model->rollback();
         }catch (\Exception $e){
             $this->model->rollback();
             return error($e->getMessage());

+ 1 - 1
app/provider.php

@@ -5,5 +5,5 @@ use app\Request;
 // 容器Provider定义文件
 return [
     'think\Request'          => Request::class,
-    'think\exception\Handle' => \app\common\Error::class,
+   # 'think\exception\Handle' => \app\common\Error::class,
 ];