Explorar el Código

供货商报销

shish hace 5 años
padre
commit
286b2d70f9

+ 2 - 2
app-ghs/controllers/ConsoleController.php

@@ -59,7 +59,7 @@ class ConsoleController extends BaseController
                 'list' => $latestIncome,
             ];
         }
-        $asset = $this->shop->attributes;
+        $asset = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
         util::success([
             'asset' => $asset,
             'notice' => $notice,
@@ -72,7 +72,7 @@ class ConsoleController extends BaseController
     public function actionInit()
     {
         $dict = dict::get();
-        $shop = $this->shop->attributes;
+        $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
         util::success(['dict' => $dict, 'shop' => $shop]);
     }
 

+ 3 - 2
app-ghs/controllers/MerchantController.php

@@ -28,11 +28,12 @@ class MerchantController extends BaseController
     //商家信息 ssh 2019.12.8
     public function actionDetail()
     {
-        $merchant = $this->sj->attributes;
+        $merchant = isset($this->sj) && !empty($this->sj) ? $this->sj->attributes : [];
         if (empty($merchant)) {
             util::success([]);
         }
-        $merchant = MerchantService::getInfo($this->sj->attributes, $this->sjExtend);
+        $ext = isset($this->sjExtend) && !empty($this->sjExtend) ? $this->sjExtend->attributes : [];
+        $merchant = MerchantService::getInfo($merchant, $ext);
         util::success($merchant);
     }
 

+ 1 - 1
app-ghs/controllers/ShopController.php

@@ -175,7 +175,7 @@ class ShopController extends BaseController
     public function actionAll()
     {
         $res = [];
-        $shopAdmin = $this->shopAdmin->attributes;
+        $shopAdmin = isset($this->shopAdmin) && !empty($this->shopAdmin) ? $this->shopAdmin->attributes : [];
         if (isset($shopAdmin['super']) && $shopAdmin['super'] == 1) {
             $res = ShopClass::getAllShop($this->sjId);
         }

+ 2 - 1
app-hd/controllers/MerchantController.php

@@ -36,7 +36,8 @@ class MerchantController extends BaseController
         if (empty($merchant)) {
             util::success([]);
         }
-        $merchant = MerchantService::getInfo($merchant, $this->sjExtend);
+        $ext = isset($this->sjExtend) && !empty($this->sjExtend) ? $this->sjExtend->attributes : [];
+        $merchant = MerchantService::getInfo($merchant, $ext);
         util::success($merchant);
     }