wugg 6 months ago
parent
commit
800fb6c07a
2 changed files with 3 additions and 3 deletions
  1. 1 1
      app/admin/controller/InvoiceItem.php
  2. 2 2
      app/admin/model/InvoiceItem.php

+ 1 - 1
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);
     }
     //查询

+ 2 - 2
app/admin/model/InvoiceItem.php

@@ -29,8 +29,8 @@ class InvoiceItem extends \think\Model {
         $change = $model->getChangedData();
         Log::info("修改发票明细状态:".json_encode($change,JSON_UNESCAPED_UNICODE));
         Log::info("跟后数据:".json_encode($model->toArray(),JSON_UNESCAPED_UNICODE));
-        if(in_array("status",$change) && ($model->status==1||$model->status==2)){
-             $num = self::where(['invoiceCode'=>$code,'order_type'=>$orderType,'status'=>0])->count(1);
+        if(in_array($change["status"],[1,2])){
+             $num = self::where(['invoiceCode'=>$code,'order_type'=>$orderType,'status'=>0])->count();
             if($num==0){
                 if($orderType==1){
                   $info= InvoicePool::where(['invNo'=>$code,'is_del'=>0])->findOrEmpty();