mirror of https://gitee.com/karson/fastadmin.git
60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
||
/**
|
||
* Created by PhpStorm.
|
||
* User: Windows 10
|
||
* Date: 2018-02-04
|
||
* Time: 10:41
|
||
*/
|
||
namespace app\api\controller;
|
||
|
||
|
||
use app\common\controller\Api;
|
||
|
||
class Productairport extends Api
|
||
{
|
||
|
||
|
||
|
||
public function _initialize()
|
||
{
|
||
parent::_initialize();
|
||
$this->model = model('product_airport');
|
||
}
|
||
/**
|
||
* 读取产品信息
|
||
*/
|
||
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);
|
||
|
||
// }
|
||
// return $this->view->fetch();
|
||
}
|
||
|
||
|
||
|
||
} |