wugg 2 years ago
parent
commit
39b757aa2b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/admin/controller/Company.php

+ 2 - 2
app/admin/controller/Company.php

@@ -193,7 +193,7 @@ class Company extends BaseController
             $ownerPlace = isset($post['ownerPlace'])&&$post['ownerPlace']!="" ? trim($post['ownerPlace']) :"";
             $denomination = isset($post['denomination'])&&$post['denomination']!="" ? trim($post['denomination']) :"";
             $invoiceType = isset($post['invoiceType'])&&!empty($post['invoiceType']) ? $post['invoiceType']:[];
-             if(($invoiceType!=''|| !empty($invoiceType))&& !empty(array_diff($invoiceType,$this->invoiceType)))
+             if(($invoiceType!=''|| !empty($invoiceType))&& !empty(array_diff(array_filter($invoiceType),$this->invoiceType)))
              	return error_show(1004,"存在无效发票类型");
         $data = [
             "company_name"=>$name,
@@ -212,7 +212,7 @@ class Company extends BaseController
            "reviewer"=>$reviewer,
            "ownerPlace"=>$ownerPlace,
            "denomination"=>$denomination,
-           "invoiceType"=>$invoiceType!=''|| !empty($invoiceType)?implode(",",$invoiceType):"",
+           "invoiceType"=>$invoiceType!=''|| !empty($invoiceType)?implode(",",array_filter($invoiceType)):"",
             "updatetime"=>date("Y-m-d H:i:s")
         ];
         $result = Db::name("company_info")->where("companyNo","=",$companyNo)->update($data);