123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?php
- // +—————————————————————————————————————————————————————————————————————
- // | Created by Yunbao
- // +—————————————————————————————————————————————————————————————————————
- // | Copyright (c) 2013~2022 http://www.yunbaokj.com All rights reserved.
- // +—————————————————————————————————————————————————————————————————————
- // | Author: https://gitee.com/yunbaokeji
- // +—————————————————————————————————————————————————————————————————————
- // | Date: 2022-02-17
- // +—————————————————————————————————————————————————————————————————————
- /**
- * 提现记录
- */
- namespace app\appapi\controller;
- use cmf\controller\HomeBaseController;
- use think\Db;
- class CashController extends HomebaseController {
-
- var $status=array(
- '0'=>'审核中',
- '1'=>'成功',
- '2'=>'失败',
- );
- public function index(){
- $data = $this->request->param();
- $uid=isset($data['uid']) ? $data['uid']: '';
- $token=isset($data['token']) ? $data['token']: '';
- $uid=(int)checkNull($uid);
- $token=checkNull($token);
-
- $checkToken=checkToken($uid,$token);
- if($checkToken==700){
- $reason='您的登陆状态失效,请重新登陆!';
- $this->assign('reason', $reason);
- return $this->fetch(':error');
- }
-
- $this->assign("uid",$uid);
- $this->assign("token",$token);
-
- $list=Db::name("cash_record")->where(["uid"=>$uid])->order("addtime desc")->limit(0,50)->select()->toArray();
- foreach($list as $k=>$v){
- $list[$k]['addtime']=date('Y.m.d',$v['addtime']);
- $list[$k]['status_name']=$this->status[$v['status']];
- }
-
- $this->assign("list",$list);
-
- return $this->fetch();
-
- }
-
- public function getlistmore()
- {
- $data = $this->request->param();
- $uid=isset($data['uid']) ? $data['uid']: '';
- $token=isset($data['token']) ? $data['token']: '';
- $p=isset($data['page']) ? $data['page']: '1';
- $uid=(int)checkNull($uid);
- $token=checkNull($token);
- $p=checkNull($p);
-
- $result=array(
- 'data'=>array(),
- 'nums'=>0,
- 'isscroll'=>0,
- );
-
- if(checkToken($uid,$token)==700){
- echo json_encode($result);
- exit;
- }
-
- $pnums=50;
- $start=($p-1)*$pnums;
- $list=Db::name("cash_record")->where(["uid"=>$uid])->order("addtime desc")->limit($start,$pnums)->select()->toArray();
- foreach($list as $k=>$v){
- $list[$k]['addtime']=date('Y.m.d',$v['addtime']);
- $list[$k]['status_name']=$this->status[$v['status']];
- }
-
- $nums=count($list);
- if($nums<$pnums){
- $isscroll=0;
- }else{
- $isscroll=1;
- }
-
- $result=array(
- 'data'=>$list,
- 'nums'=>$nums,
- 'isscroll'=>$isscroll,
- );
- echo json_encode($result);
- exit;
- }
- }
|