'api-product-controller'

pull/57/head
kaiend 2018-02-04 16:54:22 +08:00
parent e9f713b379
commit 80c4c098da
10 changed files with 555 additions and 10 deletions

View File

@ -1,23 +1,24 @@
<?php <?php
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: kaiend * User: Windows 10
* Date: 2018-02-02 * Date: 2018-02-04
* Time: 13:40 * Time: 10:41
*/ */
namespace app\api\controller; namespace app\api\controller;
use app\common\controller\Api; use app\common\controller\Api;
class Product extends Api class Productcar extends Api
{ {
public function _initialize() public function _initialize()
{ {
parent::_initialize(); parent::_initialize();
$this->model = model('Order'); $this->model = model('product_airport');
} }
/** /**
* 读取产品信息 * 读取产品信息
@ -26,13 +27,14 @@ class Product extends Api
{ {
//设置过滤方法 //设置过滤方法
$this->request->filter(['strip_tags']); $this->request->filter(['strip_tags']);
if ($this->request->isAjax()) // if ($this->request->isAjax())
{ // {
//如果发送的来源是Selectpage则转发到Selectpage //如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('pkey_name')) if ($this->request->request('pkey_name'))
{ {
return $this->selectpage(); return $this->selectpage();
} }
list($where, $sort, $order, $offset, $limit) = $this->buildparams(); list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model $total = $this->model
->where($where) ->where($where)
@ -48,8 +50,11 @@ class Product extends Api
$result = array("total" => $total, "rows" => $list); $result = array("total" => $total, "rows" => $list);
return json($result); return json($result);
}
return $this->view->fetch(); // }
// return $this->view->fetch();
} }
} }

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Productcarrental 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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Productexperience 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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Productfood 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();
}
}

View File

@ -0,0 +1,60 @@
<?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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Productlocal 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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Productmanydays 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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Productshow 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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Producttickets 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();
}
}

View File

@ -0,0 +1,60 @@
<?php
/**
* Created by PhpStorm.
* User: Windows 10
* Date: 2018-02-04
* Time: 10:41
*/
namespace app\api\controller;
use app\common\controller\Api;
class Producttraffic 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();
}
}