结算管理--更新

master
chenxiaojun 5 years ago
parent 66a238dfd4
commit 42e07d0f2f

@ -43,13 +43,13 @@ class PromoteGameRatioController extends ThinkController
if ($group == 1) {
$query = D(self::MODEL_NAME)->field($field, true)
->where($map)
->group('relation_game_id')
->group('promote_id, relation_game_id')
->order('update_time desc, id desc');
$metaTitle = $csvTitle = '公会分成管理';
} else {
$query = M(self::MODEL_NAME . '_log', 'tab_')->field($field, true)
->where($map)
->group('relation_game_id')
->group('promote_id, relation_game_id, create_time')
->order('create_time desc, id desc');
$metaTitle = $csvTitle = '公会分成申请记录';
}
@ -58,7 +58,10 @@ class PromoteGameRatioController extends ThinkController
}
$promoteGameRatios = $query->select();
if (I('export', 0) != 1) {
$count = D(self::MODEL_NAME)->where($map)->count();
$count = count(D(self::MODEL_NAME)->where($map)
->group('promote_id, relation_game_id')
->order('update_time desc, id desc')
->select());
}
$records = [];
@ -429,32 +432,6 @@ class PromoteGameRatioController extends ThinkController
}
}
}
foreach ($ids as $id) {
$thisPromoteGameRatio = D(self::MODEL_NAME)->find($id);
if (!empty($thisPromoteGameRatio)) {
$promoteGameRatios = D(self::MODEL_NAME)->where(array('relation_game_id' => $thisPromoteGameRatio['relation_game_id']))->select();
foreach ($promoteGameRatios as $promoteGameRatio) {
$model->addLog($promoteGameRatio['id']);
if ($status == 1) {
if ($promoteGameRatio['begin_time'] <= strtotime(date('Y-m-d', time()))) {
$spendMap['promote_id'] = ['in', $promoteIds];
$spendMap['game_id'] = $promoteGameRatio['relation_game_id'];
if ($promoteGameRatio['end_time'] > 0) {
$spendMap['pay_time'] = ['between', [$promoteGameRatio['begin_time'], $promoteGameRatio['end_time'] + 3600 * 24 - 1]];
} else {
$spendMap['pay_time'] = ['egt', $promoteGameRatio['begin_time']];
}
$spendMap['pay_status'] = 1;
$spendMap['selle_status'] = 0;
$spendSave['selle_ratio'] = $promoteGameRatio['ratio'];
M('spend', 'tab_')->where($spendMap)->save($spendSave);
}
}
}
}
}
$this->success('操作成功');
} else {
$this->error('操作失败');

Loading…
Cancel
Save