shish 3 лет назад
Родитель
Сommit
7d4ea5349b
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      app-mall/controllers/OrderController.php

+ 5 - 1
app-mall/controllers/OrderController.php

@@ -529,7 +529,11 @@ class OrderController extends BaseController
     //订单列表 ssh 2019.12.12
     public function actionList()
     {
-        $where = ['userId' => $this->userId];
+        $userId = $this->userId;
+        if (empty($userId)) {
+            util::success(['list' => []]);
+        }
+        $where = ['userId' => $userId];
         $list = OrderService::getOrderList($where);
         util::success($list);
     }