| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace ghs\controllers;
- use bizGhs\book\classes\BookCustomClass;
- use common\components\stringUtil;
- use common\components\util;
- use Yii;
- class BookCustomController extends BaseController
- {
- //预订客户列表 ssh 20240616
- public function actionList()
- {
- $get = Yii::$app->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]);
- }
- }
|