yingzi 2 years ago
parent
commit
261fa183a4
2 changed files with 11 additions and 4 deletions
  1. 10 3
      Controller/Shop/ApiShopProject.Class.php
  2. 1 1
      Mall/Framework/Core/SqlHelper.Class.php

+ 10 - 3
Controller/Shop/ApiShopProject.Class.php

@@ -342,8 +342,12 @@ class ApiShopProject extends BaseController
     {
         $time = $this->request->param('time');
         $uid = $this->request->param('uid');
-        
-        $rostering = $this->objRostering->details([['time', 'like', '%'.$time.'%'], ['uid', '=', $uid]]);
+        $where1 = [];
+        $where1[]=['time', 'like', '%'.$time.'%'];
+        if(!empty($uid)){
+            $where1[]=['uid', '=', $uid];
+        }
+        $rostering = $this->objRostering->details($where1);
         
         if ($rostering->isSuccess()) {
             $rostering = $rostering->getData();
@@ -353,7 +357,10 @@ class ApiShopProject extends BaseController
 
             $Stime = strtotime($time);
             $Etime = strtotime($time) + 86400;
-            $where[] = ['uid', '=', $uid];
+            if(!empty($uid)){
+                $where[] = ['uid', '=', $uid];
+            }
+            
             $where[] = ['time', '>=', $Stime];
             $where[] = ['time', '<=', $Etime];
             $rostering['reserved'] = [];

+ 1 - 1
Mall/Framework/Core/SqlHelper.Class.php

@@ -251,7 +251,7 @@ abstract class SqlHelper
         if($isExport){
             $method = 'exportSelect';
         }
-         var_dump($sql);
+//         var_dump($sql);
         $result = is_null($limit)
             ? $this->db->$method($sql, $data, $this->_fetch_style)
             : $this->db->limit($sql, $limit, $offset, $data, $this->_fetch_style);