wugg 6 months ago
parent
commit
35445cc95a
2 changed files with 7 additions and 2 deletions
  1. 3 0
      app/admin/controller/Action.php
  2. 4 2
      app/admin/controller/InvoiceItem.php

+ 3 - 0
app/admin/controller/Action.php

@@ -8,6 +8,9 @@ use think\facade\Db;
 class Action extends Base{
     public function __construct(App $app) {parent::__construct($app);}
 
+    /**("Post")
+    * @return \think\response\Json|void
+     */
     //获取素有菜单列表数据
     public function index()
     {

+ 4 - 2
app/admin/controller/InvoiceItem.php

@@ -10,7 +10,7 @@ use think\App;
 use think\facade\Validate;
 class InvoiceItem extends Base{
     public function __construct(App $app) {
-        $this->novalidate = ["*"];
+      #  $this->novalidate = ["*"];
         parent::__construct($app);
     }
     //查询
@@ -109,6 +109,8 @@ class InvoiceItem extends Base{
                 "diff_info"=>$diff,
                 "status"=>$balance>0?2:1,
                 "remark"=>$v["remark"],
+                "apply_id"=>$this->uid,
+                "apply_name"=>$this->uname
             ];
         }
         $item->startTrans();
@@ -117,7 +119,7 @@ class InvoiceItem extends Base{
             $res=(new \app\admin\model\InvoiceOrder)->saveAll($save);
             if($res){
                 $item->balance_amount = $amount;
-                $item->status = $amount=="0"?2:1; //已关联数据 $amont=0 2 还有余额则为1
+                $item->status = $amount>0?2:1; //已关联数据 $amont=0 2 还有余额则为1
                 $item->save();
             }else throw new \Exception("添加失败");
             $item->commit();