Пример #1
0
 /**
  * 
  * 返回最新的快券
  * @param skip
  * @param limit optional
  */
 function newestCoupons_get()
 {
     $skip = intval($this->input->get('skip'));
     $limit = intval($this->input->get('limit'));
     if (empty($skip)) {
         $skip = 0;
     }
     if (empty($limit)) {
         $limit = 30;
     }
     $results = $this->coupon_m->get_newest_coupons($skip, $limit);
     if ($results < 0) {
         return output_response(Error_Retrieve_Object, '获取最新快券失败');
     } else {
         $array = array('status' => 1, 'data' => $results);
         $response = json_encode($array);
         $data['response'] = $response;
         $this->load->view('response', $data);
         return $response;
     }
 }