['store_id', 'room_id'], '%like%' => ['order_sn', 'transaction_id'], 'between_time' => ['dtime'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2026/02/07 16:29 */ public function lists(): array { $mobile = ""; if(isset($this->params['mobile'])){ if($this->params['mobile']!=""&&$this->params['mobile']!=null){ $mobile = "d.mobile like '%".$this->params['mobile']."%'"; } } $store_name = ""; if(isset($this->params['store_name'])){ if($this->params['store_name']!=""&&$this->params['store_name']!=null){ $store_name = "b.name like '%".$this->params['store_name']."%'"; } } $room_name = ""; if(isset($this->params['room_name'])){ if($this->params['room_name']!=""&&$this->params['room_name']!=null){ $room_name = "c.title like ".$this->params['room_name'].""; } } return OrderStore::alias("a") ->where($this->searchWhere) ->field(['a.id', 'a.order_sn', 'a.transaction_id', 'a.store_id', 'a.room_id', 'a.user_id', 'a.day_title', 'a.day_time', 'a.start_time', 'a.end_time', 'a.hours', 'a.timeslot', 'a.room_price', 'a.room_all_price', 'a.user_coupon_id', 'a.coupon_price', 'a.group_coupon_id', 'a.group_price', 'a.member_price', 'a.order_amount', 'a.is_member_price', 'a.service_price', 'a.store_income_price', 'a.earnings_price', 'a.remark', 'a.is_release', 'a.order_terminal', 'a.is_renewal', 'a.is_transfer', 'a.transfer_order_id', 'a.renew_dtime', 'a.renew_hour', 'a.renew_price', 'a.pay_way', 'a.store_user_order', 'a.order_status', 'a.pay_status', 'a.gate_key', 'a.room_key', 'a.roomcardpwd_id', 'a.storecardpwd_id', 'a.is_lockpwd', 'a.dtime', 'a.update_dtime', 'b.name as store_name','c.title as room_name','d.avatar','d.nickname','d.mobile']) ->limit($this->limitOffset, $this->limitLength) ->join("tea_store b","b.id=a.store_id","left") ->join("tea_store_room c","c.id=a.room_id","left") ->join("user d","d.id=a.user_id","left") ->where($mobile) ->where($store_name) ->where($room_name) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2026/02/07 16:29 */ public function count(): int { return OrderStore::where($this->searchWhere)->count(); } }