|
|
|
@ -56,14 +56,15 @@ class User extends BaseController |
|
|
|
$limit = $data['limit'] ?: 10; |
|
|
|
|
|
|
|
$list = Db::name('withdrawal_records') |
|
|
|
->where('user_id',$userData['id']) |
|
|
|
->field('withdrawal_amount,withdrawal_balence,apply_time') |
|
|
|
->where(['user_id' => $userData['id'], 'status' => 1]) |
|
|
|
->field('withdrawal_amount,withdrawal_balance,apply_time') |
|
|
|
->order('id' ,'desc') |
|
|
|
->paginate($limit); |
|
|
|
|
|
|
|
$listArr = $list->items(); |
|
|
|
|
|
|
|
foreach ($listArr as &$item) { |
|
|
|
give_symbol($item['withdrawal_amount'],'-'); |
|
|
|
$item['apply_time'] = date("m月d日 H:i",strtotime($item['apply_time'])); |
|
|
|
} |
|
|
|
|
|
|
|
@ -95,6 +96,7 @@ class User extends BaseController |
|
|
|
$listArr = $list->items(); |
|
|
|
|
|
|
|
foreach ($listArr as &$item) { |
|
|
|
give_symbol($item['recharge_amount']); |
|
|
|
$item['recharge_time'] = date("m月d日 H:i",strtotime($item['recharge_time'])); |
|
|
|
} |
|
|
|
|
|
|
|
@ -103,4 +105,68 @@ class User extends BaseController |
|
|
|
'total' => $list->total() |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 消费记录 |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
*/ |
|
|
|
public function consumptionRecords() |
|
|
|
{ |
|
|
|
$userData = Session::get('login_user_data'); |
|
|
|
|
|
|
|
$data = Request::param(); |
|
|
|
|
|
|
|
$limit = $data['limit'] ?: 10; |
|
|
|
|
|
|
|
$list = Db::name('consumption_records') |
|
|
|
->where(['user_id' => $userData['id'],'status' => 1]) |
|
|
|
->field('actual_price,residue_amount,create_time') |
|
|
|
->order('id' ,'desc') |
|
|
|
->paginate($limit); |
|
|
|
|
|
|
|
$listArr = $list->items(); |
|
|
|
|
|
|
|
foreach ($listArr as &$item) { |
|
|
|
give_symbol($item['actual_price'],'-'); |
|
|
|
$item['create_time'] = date("m月d日 H:i",strtotime($item['create_time'])); |
|
|
|
} |
|
|
|
|
|
|
|
return $this->renderSuccess('数据获取成功',[ |
|
|
|
'list' => $listArr, |
|
|
|
'total' => $list->total() |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 中奖记录 |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
*/ |
|
|
|
public function awardsRecords() |
|
|
|
{ |
|
|
|
$userData = Session::get('login_user_data'); |
|
|
|
|
|
|
|
$data = Request::param(); |
|
|
|
|
|
|
|
$limit = $data['limit'] ?: 10; |
|
|
|
|
|
|
|
$list = Db::name('awards_records') |
|
|
|
->where('user_id',$userData['id']) |
|
|
|
->field('awards_amount,withdrawal_balance,create_time') |
|
|
|
->order('id' ,'desc') |
|
|
|
->paginate($limit); |
|
|
|
|
|
|
|
$listArr = $list->items(); |
|
|
|
|
|
|
|
foreach ($listArr as &$item) { |
|
|
|
give_symbol($item['awards_amount']); |
|
|
|
$item['create_time'] = date("m月d日 H:i",strtotime($item['create_time'])); |
|
|
|
} |
|
|
|
|
|
|
|
return $this->renderSuccess('数据获取成功',[ |
|
|
|
'list' => $listArr, |
|
|
|
'total' => $list->total() |
|
|
|
]); |
|
|
|
} |
|
|
|
} |