shish před 3 roky
rodič
revize
bf407142a6
1 změnil soubory, kde provedl 15 přidání a 1 odebrání
  1. 15 1
      app-ghs/controllers/ConsoleController.php

+ 15 - 1
app-ghs/controllers/ConsoleController.php

@@ -15,7 +15,7 @@ use Yii;
 class ConsoleController extends BaseController
 {
 
-    public $guestAccess = ['init', 'profile'];
+    public $guestAccess = ['init', 'profile', 'Stroke-count', 'stat'];
 
     //总览
     public function actionStat()
@@ -59,6 +59,20 @@ class ConsoleController extends BaseController
     //系统收入、客服收入、欠款
     public function actionStrokeCount()
     {
+
+        if (empty($this->mainId)) {
+            util::success([
+                'systemIncome' => 0,
+                'systemCount' => 0,
+                'debtCount' => 0,
+                'debtIncome' => 0,
+                'kfWxCount' => 0,
+                'kfWxIncome' => 0,
+                'cashCount' => 0,
+                'cashIncome' => 0,
+            ]);
+        }
+
         $incomeList = StatKdClass::eachChannelIncome($this->mainId, $this->shop);
 
         $systemIncome1 = $incomeList['system']['category']['ls']['amount'] ?? 0;