wugg 8 months ago
parent
commit
24f9e462f0
2 changed files with 5 additions and 3 deletions
  1. 3 3
      app/user/controller/Supplier.php
  2. 2 0
      app/user/model/SupplierContact.php

+ 3 - 3
app/user/controller/Supplier.php

@@ -119,7 +119,7 @@ class Supplier extends Base{
                 'createrid'=>$this->uid
             ];
             $create = \app\user\model\Supplier::create(array_merge($data,$param));
-            if(!$create->isEmpty())throw new \Exception('供应商创建失败');
+            if($create->isEmpty())throw new \Exception('供应商创建失败');
                 $contact=[
                     "code"=>$data['code'],
                     "contactor"=>$param['contactor'],
@@ -129,11 +129,11 @@ class Supplier extends Base{
                     "email"=>$param['email'],
                     ];
                 $contactC= SupplierContact::create($contact);
-                if (!$contactC->isEmpty())throw new \Exception("供应商联系人信息创建失败");
+                if ($contactC->isEmpty())throw new \Exception("供应商联系人信息创建失败");
                 $create->updater=$this->uname;
                 $create->updaterid=$this->uid;
                 $hqcreate= Headquarters::createInfo($create,3);
-                if (!$hqcreate)throw new \Exception("供应商信息创建失败");
+                if ($hqcreate)throw new \Exception("供应商信息创建失败");
         }catch (\Exception $exception){
             $this->model->rollback();
             return error($exception->getMessage());

+ 2 - 0
app/user/model/SupplierContact.php

@@ -17,4 +17,6 @@ class SupplierContact extends Base
         'updatetime'       =>'datetime',//
 
     ];
+    protected $createTime = 'addtime';
+    protected $updateTime = 'updatetime';
 }