ソースを参照

修复首次登陆问题

shish 5 年 前
コミット
2a057a42a9

+ 18 - 12
app-hd/controllers/ConsoleController.php

@@ -48,19 +48,25 @@ class ConsoleController extends BaseController
             }
         }
 
-        //今天访客
-        $todayVisit = StatVisitService::getTodayVisitNum($this->shopId);
-        //今天开单
-        $orderData = StatOrderService::getTodayNum($this->shopId);
-        $todayOrder = isset($orderData['riseNum']) ? $orderData['riseNum'] : 0;
-        //今天收入
-        $incomeData = StatIncomeService::getTodayNum($this->shopId);
-        $todayIncome = isset($incomeData['amount']) ? $incomeData['amount'] : 0;
-        //今天新学员数
-        $newStudent = StatStudentClass::getTodayNum($this->shop);
-        //今日概况
+        if (isset($this->shop) && !empty($this->shop)) {
+            //今天访客
+            $todayVisit = StatVisitService::getTodayVisitNum($this->shopId);
+            //今天开单
+            $orderData = StatOrderService::getTodayNum($this->shopId);
+            $todayOrder = isset($orderData['riseNum']) ? $orderData['riseNum'] : 0;
+            //今天收入
+            $incomeData = StatIncomeService::getTodayNum($this->shopId);
+            $todayIncome = isset($incomeData['amount']) ? $incomeData['amount'] : 0;
+            //今天新学员数
+            $newStudent = StatStudentClass::getTodayNum($this->shop);
+            //今日概况
+        } else {
+            $todayVisit = 0;
+            $todayIncome = 0.00;
+            $todayOrder = 0;
+            $newStudent = 0;
+        }
         $todayData = ['visit' => $todayVisit, 'income' => $todayIncome, 'order' => $todayOrder, 'newStudent' => $newStudent];
-
         $incomeStat = [];
         if (httpUtil::isMiniProgram() == false) {
             //当月的收入

+ 5 - 0
biz-ghs/admin/classes/AdminClass.php

@@ -337,6 +337,11 @@ class AdminClass extends BaseClass
         $getAdminInfo['addTime'] = $time;
         $getAdminInfo['source'] = isset($getAdminInfo['source']) ? $getAdminInfo['source'] : 0;
         $getAdminInfo['hasSubscribe'] = 0;
+        $getAdminInfo['currentShopId'] = 0;
+        $getAdminInfo['currentShopId'] = $getAdminInfo['currentShopId'] ?? '';
+        $getAdminInfo['openShop'] = $getAdminInfo['openShop'] ?? \biz\admin\classes\AdminClass::OPEN_SHOP_NO;
+        $getAdminInfo['super'] = $getAdminInfo['super'] ?? \biz\admin\classes\AdminClass::SUPER_NO;
+        $getAdminInfo['delStatus'] = 0;
 
         if (isset($getAdminInfo['headImgUrl']) && !empty($getAdminInfo['headImgUrl'])) {
             $imgUrl = $getAdminInfo['headImgUrl'];

+ 6 - 3
biz/admin/classes/AdminClass.php

@@ -16,12 +16,15 @@ class AdminClass extends BaseClass
     const OPEN_SHOP_CHECK = 2;
     const OPEN_SHOP_YES = 3;
 
+    const SUPER_YES = 1;
+    const SUPER_NO = 0;
+
     //linqh 2021.5.14  [id=>adminData]
     public static function getAdminMap($adminIds)
     {
         $where = [];
-        $where['id'] =  ['in', $adminIds];
-        $data = self::getAllByCondition($where,null,"*");
-        return array_column($data,null,"id");
+        $where['id'] = ['in', $adminIds];
+        $data = self::getAllByCondition($where, null, "*");
+        return array_column($data, null, "id");
     }
 }