|
|
|
@ -5,7 +5,9 @@ use app\BaseController; |
|
|
|
use app\model\User as UserModel; |
|
|
|
use app\validate\User as UserValidate; |
|
|
|
use think\exception\ValidateException; |
|
|
|
use think\facade\Db; |
|
|
|
use think\facade\Request; |
|
|
|
use think\facade\Session; |
|
|
|
|
|
|
|
class User extends BaseController |
|
|
|
{ |
|
|
|
@ -39,4 +41,66 @@ class User extends BaseController |
|
|
|
return $this->renderError($exception->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 提现记录 |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
*/ |
|
|
|
public function withdrawalRecords() |
|
|
|
{ |
|
|
|
$userData = Session::get('login_user_data'); |
|
|
|
|
|
|
|
$data = Request::param(); |
|
|
|
|
|
|
|
$limit = $data['limit'] ?: 10; |
|
|
|
|
|
|
|
$list = Db::name('withdrawal_records') |
|
|
|
->where('user_id',$userData['id']) |
|
|
|
->field('withdrawal_amount,withdrawal_balence,apply_time') |
|
|
|
->order('id' ,'desc') |
|
|
|
->paginate($limit); |
|
|
|
|
|
|
|
$listArr = $list->items(); |
|
|
|
|
|
|
|
foreach ($listArr as &$item) { |
|
|
|
$item['apply_time'] = date("m月d日 H:i",strtotime($item['apply_time'])); |
|
|
|
} |
|
|
|
|
|
|
|
return $this->renderSuccess('数据获取成功',[ |
|
|
|
'list' => $listArr, |
|
|
|
'total' => $list->total() |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 充值记录 |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
*/ |
|
|
|
public function rechargeRecords() |
|
|
|
{ |
|
|
|
$userData = Session::get('login_user_data'); |
|
|
|
|
|
|
|
$data = Request::param(); |
|
|
|
|
|
|
|
$limit = $data['limit'] ?: 10; |
|
|
|
|
|
|
|
$list = Db::name('recharge_records') |
|
|
|
->where('user_id',$userData['id']) |
|
|
|
->field('recharge_amount,residue_amount,recharge_time') |
|
|
|
->order('id' ,'desc') |
|
|
|
->paginate($limit); |
|
|
|
|
|
|
|
$listArr = $list->items(); |
|
|
|
|
|
|
|
foreach ($listArr as &$item) { |
|
|
|
$item['recharge_time'] = date("m月d日 H:i",strtotime($item['recharge_time'])); |
|
|
|
} |
|
|
|
|
|
|
|
return $this->renderSuccess('数据获取成功',[ |
|
|
|
'list' => $listArr, |
|
|
|
'total' => $list->total() |
|
|
|
]); |
|
|
|
} |
|
|
|
} |