mirror of https://gitee.com/karson/fastadmin.git
order
parent
065db70a71
commit
5afdf74fc2
|
|
@ -16,6 +16,11 @@ use app\common\controller\Api;
|
|||
*/
|
||||
class Order extends Api
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = model('Order');
|
||||
}
|
||||
/**
|
||||
* 插入订单
|
||||
* @return mixed
|
||||
|
|
@ -61,19 +66,36 @@ class Order extends Api
|
|||
//return $this->view->fetch();
|
||||
return json('',200,[],'');
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
/**
|
||||
* 读取订单
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$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();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -108,13 +130,5 @@ class Order extends Api
|
|||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示订单
|
||||
*/
|
||||
public function order_list()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue