1 个管道
的构建
通过
耗费
1 秒
Merge branch 'master' of http://114.215.101.231:8099/guosheng/community into Branch_liuzhen
正在显示
2 个修改的文件
包含
12 行增加
和
19 行删除
@@ -648,19 +648,9 @@ class HouseBoard extends Api | @@ -648,19 +648,9 @@ class HouseBoard extends Api | ||
648 | */ | 648 | */ |
649 | private function getActivityList($where){ | 649 | private function getActivityList($where){ |
650 | $list = Db::name('house_activity') | 650 | $list = Db::name('house_activity') |
651 | - ->alias('ha') | ||
652 | - ->join('house_join hj','ha.id = hj.house_activity_id and hj.user_id ='.$this->auth->id,'left') | ||
653 | ->where($where) | 651 | ->where($where) |
654 | - ->field(' | ||
655 | - ha.id, | ||
656 | - ha.title, | ||
657 | - ha.content, | ||
658 | - ha.start_time, | ||
659 | - ha.end_time, | ||
660 | - ha.spec_type, | ||
661 | - hj.join_status | ||
662 | - ') | ||
663 | - ->order("ha.createtime desc") | 652 | + ->field('id,title,content,start_time,end_time,spec_type') |
653 | + ->order('createtime desc') | ||
664 | ->select(); | 654 | ->select(); |
665 | foreach ($list as $k => &$v) { | 655 | foreach ($list as $k => &$v) { |
666 | // 活动报名费用 | 656 | // 活动报名费用 |
@@ -669,13 +659,18 @@ class HouseBoard extends Api | @@ -669,13 +659,18 @@ class HouseBoard extends Api | ||
669 | // 活动日期 | 659 | // 活动日期 |
670 | $v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']); | 660 | $v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']); |
671 | // 活动状态 | 661 | // 活动状态 |
672 | - if($v['join_status'] == '1'){ | 662 | + $join = Db::name('house_join') |
663 | + ->where('house_activity_id',$v['id']) | ||
664 | + ->where('user_id',$this->auth->id) | ||
665 | + ->where('join_status','1') | ||
666 | + ->find(); | ||
667 | + if($join){ | ||
673 | $status = ['text'=>'已报名','value'=>1]; | 668 | $status = ['text'=>'已报名','value'=>1]; |
674 | }else{ | 669 | }else{ |
675 | $status = $v['end_time'] < time() ? ['text'=>'已到期','value'=>2] : ['text'=>'报名中','value'=>0]; | 670 | $status = $v['end_time'] < time() ? ['text'=>'已到期','value'=>2] : ['text'=>'报名中','value'=>0]; |
676 | } | 671 | } |
677 | $v['status'] = $status; | 672 | $v['status'] = $status; |
678 | - unset($v['start_time'],$v['end_time'],$v['join_status']); | 673 | + unset($v['start_time'],$v['end_time']); |
679 | } | 674 | } |
680 | return $list; | 675 | return $list; |
681 | } | 676 | } |
@@ -129,9 +129,7 @@ class User extends Api | @@ -129,9 +129,7 @@ class User extends Api | ||
129 | ->select(); | 129 | ->select(); |
130 | $today_money = 0; | 130 | $today_money = 0; |
131 | foreach ($plus_today as $v) { | 131 | foreach ($plus_today as $v) { |
132 | - if($v['before'] > $v['after']) { | ||
133 | - $today_money -= $v['money']; | ||
134 | - } else { | 132 | + if($v['before'] < $v['after']) { |
135 | $today_money += $v['money']; | 133 | $today_money += $v['money']; |
136 | } | 134 | } |
137 | } | 135 | } |
@@ -811,8 +809,6 @@ class User extends Api | @@ -811,8 +809,6 @@ class User extends Api | ||
811 | 'money' => $param['money'], | 809 | 'money' => $param['money'], |
812 | ]; | 810 | ]; |
813 | $result = $withdraw_model->isUpdate(false)->save($withdraw); | 811 | $result = $withdraw_model->isUpdate(false)->save($withdraw); |
814 | - // 记录用户余额 | ||
815 | - $result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'money' => $user['money'] - $param['money']]); | ||
816 | // 记录余额变更 | 812 | // 记录余额变更 |
817 | $insert_data = array( | 813 | $insert_data = array( |
818 | 'user_id' => $this->auth->id, | 814 | 'user_id' => $this->auth->id, |
@@ -824,6 +820,8 @@ class User extends Api | @@ -824,6 +820,8 @@ class User extends Api | ||
824 | 'memo' => '用户提现', | 820 | 'memo' => '用户提现', |
825 | ); | 821 | ); |
826 | $res_log = Db::name('user_money_log')->insert($insert_data); | 822 | $res_log = Db::name('user_money_log')->insert($insert_data); |
823 | + // 记录用户余额 | ||
824 | + $result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'money' => $user['money'] - $param['money']]); | ||
827 | if (!$result || !$result_user || !$res_log) { | 825 | if (!$result || !$result_user || !$res_log) { |
828 | Db::rollback(); | 826 | Db::rollback(); |
829 | $this->error('提现申请失败', [$result, $result_user]); | 827 | $this->error('提现申请失败', [$result, $result_user]); |
-
请 注册 或 登录 后发表评论