fastadmin/application/api/controller/Producthotels.php

60 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Producthotels extends Api
{
public function _initialize()
{
parent::_initialize();
$this->model = model('product_day');
}
/**
* 读取产品信息
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
// if ($this->request->isAjax())
// {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('pkey_name'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
// $this->success('','',json(),$result);
// }
// return $this->view->fetch();
}
}