作者 Cool
1 个管道 的构建 通过 耗费 1 秒

Merge branch 'master' of http://114.215.101.231:8099/guosheng/community into Branch_liuzhen

... ... @@ -648,19 +648,9 @@ class HouseBoard extends Api
*/
private function getActivityList($where){
$list = Db::name('house_activity')
->alias('ha')
->join('house_join hj','ha.id = hj.house_activity_id and hj.user_id ='.$this->auth->id,'left')
->where($where)
->field('
ha.id,
ha.title,
ha.content,
ha.start_time,
ha.end_time,
ha.spec_type,
hj.join_status
')
->order("ha.createtime desc")
->field('id,title,content,start_time,end_time,spec_type')
->order('createtime desc')
->select();
foreach ($list as $k => &$v) {
// 活动报名费用
... ... @@ -669,13 +659,18 @@ class HouseBoard extends Api
// 活动日期
$v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']);
// 活动状态
if($v['join_status'] == '1'){
$join = Db::name('house_join')
->where('house_activity_id',$v['id'])
->where('user_id',$this->auth->id)
->where('join_status','1')
->find();
if($join){
$status = ['text'=>'已报名','value'=>1];
}else{
$status = $v['end_time'] < time() ? ['text'=>'已到期','value'=>2] : ['text'=>'报名中','value'=>0];
}
$v['status'] = $status;
unset($v['start_time'],$v['end_time'],$v['join_status']);
unset($v['start_time'],$v['end_time']);
}
return $list;
}
... ...
... ... @@ -129,9 +129,7 @@ class User extends Api
->select();
$today_money = 0;
foreach ($plus_today as $v) {
if($v['before'] > $v['after']) {
$today_money -= $v['money'];
} else {
if($v['before'] < $v['after']) {
$today_money += $v['money'];
}
}
... ... @@ -811,8 +809,6 @@ class User extends Api
'money' => $param['money'],
];
$result = $withdraw_model->isUpdate(false)->save($withdraw);
// 记录用户余额
$result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'money' => $user['money'] - $param['money']]);
// 记录余额变更
$insert_data = array(
'user_id' => $this->auth->id,
... ... @@ -824,6 +820,8 @@ class User extends Api
'memo' => '用户提现',
);
$res_log = Db::name('user_money_log')->insert($insert_data);
// 记录用户余额
$result_user = $user_model->isUpdate(true)->save(['id'=>$this->auth->id,'money' => $user['money'] - $param['money']]);
if (!$result || !$result_user || !$res_log) {
Db::rollback();
$this->error('提现申请失败', [$result, $result_user]);
... ...