login_white = array('get');//登录白名单 $this->check_status = array();//用户状态校验 $this->check_mobile = array();//需要手机号 $this->check_headimg =array();//授权微信信息 $this->load->model('auto/auto_option_model'); } protected function get(){ $page = $this->input_param('page'); $size = $this->input_param('size'); $s_id = $this->input_param('id'); //车系id !$page && $page = 1; !$size && $size = 100; $where = [ 'status' => 1, 's_id' => $s_id ]; $count = $this->auto_option_model->count($where); $lists = []; if($count){ $rows = $this->auto_option_model->select($where,'id desc',$page,$size); foreach ($rows as $item) { $lists[] = [ 'id' => $item['id'], 'title' => $item['title'], 'descrip' => $item['descrip'], 'price' => $item['price'] ]; } } $data = [ 'list' => $lists, 'total' => $count ]; return $data; } }