Esempio n. 1
0
 /**
  * 处理请求参数
  */
 protected function handleRequest()
 {
     Request::offsetSet('order', json_decode(Request::input('order', '[]')) ?: (isset($this->defaultOrder) ? $this->defaultOrder : []));
     //排序处理
     $where = Request::input('where', []);
     $where = is_array($where) ? collect($where)->map(function ($item) {
         if (!is_array($item)) {
             return json_decode($item, true);
         } else {
             return $item;
         }
     })->toArray() : json_decode($where, true);
     if (Request::input('dateStart')) {
         $where[0] = ['key' => $this->dateFiled, 'type' => 'dateStart', 'val' => Request::input('dateStart'), 'exp' => '>='];
     }
     if (Request::input('dateEnd')) {
         $where[1] = ['key' => $this->dateFiled, 'type' => 'dateEnd', 'val' => Request::input('dateEnd'), 'exp' => '<='];
     }
     Request::offsetSet('where', $where);
     //条件筛选处理
 }