request->get(); $where = []; $where['mainId'] = $this->mainId; $bookSn = $get['bookSn'] ?? ''; if (empty($bookSn)) { $shop = $this->shop; $bookSn = $shop->bookSn ?? 0; if (empty($bookSn)) { util::success(['list' => [], 'hint' => 'no bookSn']); } } $search = $get['search']??''; $where['bookSn'] = $bookSn; if (!empty($search)) { if(is_numeric($search)){ $where['seatSn'] = $search; }elseif (stringUtil::isLetter($search)) { $search = strtolower($search); $where['py'] = ['like', $search]; } else { $where['name'] = ['like', $search]; } } $list = BookCustomClass::getAllByCondition($where, '(bookNum-onNum) DESC', '*'); util::success(['list' => $list]); } }