123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace Mobile\Controller;
- class AjaxsController extends MobileController
- {
- protected function _initialize()
- {
- parent::_initialize(); $allow_action=array("laverorder");
- if(!in_array(ACTION_NAME,$allow_action)){
- $this->error(L("非法操作"));
- }
- }
- public function laverorder($type)
- {
- $uid = userid();
- if($uid <= 0){
- $this->ajaxReturn(['code' => 3, 'data' => '', 'info' => L('未登录')]);
- }
- if ($type == 1){
- //委托订单
- $list = M("leverorder")->where(array('uid'=>$uid,'status'=>1))->order("id desc")->select();
- }elseif ($type == 2){
- //持仓订单
- $list = M("leverorder")->where(array('uid'=>$uid,'status'=>2))->order("id desc")->select();
- }elseif ($type == 3){
- //成交订单
- $list = M("leverorder")->where("uid = {$uid} and (status = 3 or status = 4)")->order("id desc")->select();
- }
- $data = [
- 'code' => 1,
- 'list' => $list,//委托
- 'msg' => ''
- ];
- $this->ajaxReturn($data);
- }
- }
- ?>
|