[ 'ww.lang_id', 'ww.method_id', 'ww.type', 'ww.is_disable'], ]; } /** * @notes 搜索条件 * @author 段誉 * @date 2023/2/24 16:08 */ public function queryWhere() { $where = []; // 用户编号 if (!empty($this->params['user_info'])) { $where[] = ['u.sn|u.account|u.mobile', '=', $this->params['user_info']]; } // 下单时间 if (!empty($this->params['start_time']) && !empty($this->params['end_time'])) { $time = [strtotime($this->params['start_time']), strtotime($this->params['end_time'])]; $where[] = ['ww.create_time', 'between', $time]; } return $where; } /** * @notes 获取用户提现钱包列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author BD * @date 2024/02/26 13:32 */ public function lists(): array { $field = 'ww.id,ww.lang_id,ww.user_id,ww.method_id,ww.bank_id,ww.type,ww.name,ww.account,ww.img,ww.is_disable,ww.create_time,ww.update_time'; $field .= ',u.account as u_account,u.sn as u_sn,u.mobile'; return WithdrawWallet::alias('ww') ->join('user u', 'u.id = ww.user_id') ->field($field) ->append(['lang_name','method_name','bank_name','status_text']) ->where($this->queryWhere()) ->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['ww.id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取用户提现钱包数量 * @return int * @author BD * @date 2024/02/26 13:32 */ public function count(): int { return WithdrawWallet::alias('ww') ->join('user u', 'u.id = ww.user_id') ->where($this->queryWhere()) ->where($this->searchWhere) ->count(); } }