|
@@ -34,10 +34,10 @@ class Userwallet extends Api
|
|
|
|
|
|
//我的收益,三个数据
|
|
|
public function my_income_count(){
|
|
|
- //累计收益
|
|
|
+ //累计收益,不计来源
|
|
|
$map = [
|
|
|
'user_id' => $this->auth->id,
|
|
|
- 'log_type'=> ['IN',[21,22,23]],
|
|
|
+ //'log_type'=> ['IN',[21,22,23]],
|
|
|
];
|
|
|
$income_sum = Db::name('user_money_log')->where($map)->sum('change_value');
|
|
|
|
|
@@ -59,6 +59,57 @@ class Userwallet extends Api
|
|
|
$this->success('success',$result);
|
|
|
}
|
|
|
|
|
|
+ //追加log_text
|
|
|
+ private function list_appen_logtext($list){
|
|
|
+ if(!empty($list)){
|
|
|
+ $conf = config('wallet.logtype');
|
|
|
+ foreach($list as $key => $val){
|
|
|
+ $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+
|
|
|
+ //互动收益,打视频,语音,文字聊天,聊天送礼物
|
|
|
+ public function hudong_money(){
|
|
|
+ $map = [
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ 'log_type'=> ['IN',[21,22,23,54]],
|
|
|
+ ];
|
|
|
+ $list = Db::name('user_money_log')
|
|
|
+ ->field('id,log_type,change_value,remain,remark,createtime')
|
|
|
+ ->where($map)->order('id desc')->autopage()->select();
|
|
|
+
|
|
|
+ $list = $this->list_appen_logtext($list);
|
|
|
+ $this->success('success',$list);
|
|
|
+ }
|
|
|
+ //音聊收益,语聊间礼物
|
|
|
+ public function party_money(){
|
|
|
+ $map = [
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ 'log_type'=> 52,
|
|
|
+ ];
|
|
|
+ $list = Db::name('user_money_log')
|
|
|
+ ->field('id,log_type,change_value,remain,remark,createtime')
|
|
|
+ ->where($map)->order('id desc')->autopage()->select();
|
|
|
+
|
|
|
+ $list = $this->list_appen_logtext($list);
|
|
|
+ $this->success('success',$list);
|
|
|
+ }
|
|
|
+ //直播收益,直播间礼物
|
|
|
+ public function livebc_money(){
|
|
|
+ $map = [
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ 'log_type'=> 56,
|
|
|
+ ];
|
|
|
+ $list = Db::name('user_money_log')
|
|
|
+ ->field('id,log_type,change_value,remain,remark,createtime')
|
|
|
+ ->where($map)->order('id desc')->autopage()->select();
|
|
|
+
|
|
|
+ $list = $this->list_appen_logtext($list);
|
|
|
+ $this->success('success',$list);
|
|
|
+ }
|
|
|
+
|
|
|
//我的余额日志
|
|
|
public function my_money_log(){
|
|
|
$type = input_post('type',0);
|
|
@@ -70,13 +121,10 @@ class Userwallet extends Api
|
|
|
$map['log_type'] = $type;
|
|
|
}
|
|
|
|
|
|
- $list = Db::name('user_money_log')->field('id,log_type,change_value,remain,createtime')->where($map)->order('id desc')->autopage()->select();
|
|
|
- if(!empty($list)){
|
|
|
- $conf = config('wallet.logtype');
|
|
|
- foreach($list as $key => $val){
|
|
|
- $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : '';
|
|
|
- }
|
|
|
- }
|
|
|
+ $list = Db::name('user_money_log')
|
|
|
+ ->field('id,log_type,change_value,remain,remark,createtime')
|
|
|
+ ->where($map)->order('id desc')->autopage()->select();
|
|
|
+ $list = $this->list_appen_logtext($list);
|
|
|
|
|
|
$this->success('success',$list);
|
|
|
}
|