['name'], '=' => ['status','pid'] ]; } /** * @notes 广告列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author ljj * @date 2022/2/14 6:02 下午 */ public function lists(): array { $lists = (new Ad())->field('id,name,pid,image,link_type,link_address,sort,status') ->order(['sort'=>'desc','id'=>'desc']) ->append(['link_address_desc','ap_name']) ->where($this->searchWhere) ->limit($this->limitOffset,$this->limitLength) ->select() ->toArray(); return $lists; } /** * @notes 广告总数 * @return int * @author ljj * @date 2022/2/14 6:03 下午 */ public function count(): int { return (new Ad())->where($this->searchWhere)->count(); } }