|
|
@ -3,6 +3,7 @@
|
|
|
|
namespace Admin\Controller;
|
|
|
|
namespace Admin\Controller;
|
|
|
|
|
|
|
|
|
|
|
|
use Think\Controller;
|
|
|
|
use Think\Controller;
|
|
|
|
|
|
|
|
use Admin\Model\PromoteGameRatioModel;
|
|
|
|
|
|
|
|
|
|
|
|
class PromoteGameRatioController extends ThinkController
|
|
|
|
class PromoteGameRatioController extends ThinkController
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -20,6 +21,7 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
public function lists()
|
|
|
|
public function lists()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$params = I('get.');
|
|
|
|
$params = I('get.');
|
|
|
|
|
|
|
|
$group = $params['group'] ?? 1;
|
|
|
|
$promoteId = $params['promote_id'] ?? 0;
|
|
|
|
$promoteId = $params['promote_id'] ?? 0;
|
|
|
|
$gameId = $params['game_id'] ?? 0;
|
|
|
|
$gameId = $params['game_id'] ?? 0;
|
|
|
|
$status = $params['status'] ?? '';
|
|
|
|
$status = $params['status'] ?? '';
|
|
|
@ -38,9 +40,17 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$field = 'create_time, update_time';
|
|
|
|
$field = 'create_time, update_time';
|
|
|
|
|
|
|
|
if ($group == 1) {
|
|
|
|
$query = D(self::MODEL_NAME)->field($field, true)
|
|
|
|
$query = D(self::MODEL_NAME)->field($field, true)
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->order('update_time desc, id desc');
|
|
|
|
->order('update_time desc, id desc');
|
|
|
|
|
|
|
|
$metaTitle = $csvTitle = '公会分成管理';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$query = M(self::MODEL_NAME . '_log', 'tab_')->field($field, true)
|
|
|
|
|
|
|
|
->where($map)
|
|
|
|
|
|
|
|
->order('create_time desc, id desc');
|
|
|
|
|
|
|
|
$metaTitle = $csvTitle = '公会分成申请记录';
|
|
|
|
|
|
|
|
}
|
|
|
|
if (I('export', 0) != 1) {
|
|
|
|
if (I('export', 0) != 1) {
|
|
|
|
$query->page($page, $row);
|
|
|
|
$query->page($page, $row);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -107,7 +117,7 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
'promote_status_text' => $thisPromoteStatus,
|
|
|
|
'promote_status_text' => $thisPromoteStatus,
|
|
|
|
'promote_ver_status_text' => $thisPromoteVerStatus,
|
|
|
|
'promote_ver_status_text' => $thisPromoteVerStatus,
|
|
|
|
'game_name' => $thisGameName,
|
|
|
|
'game_name' => $thisGameName,
|
|
|
|
'last_ratio' => (($thisLastRatioStatus == 1) ? $thisLastRatio : $thisGameRatio),
|
|
|
|
'last_ratio' => (($thisLastRatioStatus == 1 || $group != 1) ? $thisLastRatio : $thisGameRatio),
|
|
|
|
'ratio' => $thisRatio,
|
|
|
|
'ratio' => $thisRatio,
|
|
|
|
'valid_date' => $validDate,
|
|
|
|
'valid_date' => $validDate,
|
|
|
|
'remark' => $promoteGameRatio['remark'],
|
|
|
|
'remark' => $promoteGameRatio['remark'],
|
|
|
@ -139,7 +149,7 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
'applicant' => '申请人',
|
|
|
|
'applicant' => '申请人',
|
|
|
|
'reviewer' => '确认人',
|
|
|
|
'reviewer' => '确认人',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
data2csv($records,"公会分成管理", $field);
|
|
|
|
data2csv($records,$csvTitle, $field);
|
|
|
|
exit;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -148,6 +158,7 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
if($page) {
|
|
|
|
if($page) {
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->assign('group', $group);
|
|
|
|
$this->assign('records', $records);
|
|
|
|
$this->assign('records', $records);
|
|
|
|
$this->assign('count', $count);
|
|
|
|
$this->assign('count', $count);
|
|
|
|
$this->assign('gameList', getAllGameList());
|
|
|
|
$this->assign('gameList', getAllGameList());
|
|
|
@ -155,7 +166,7 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
$this->assign('statusList', self::$statusList);
|
|
|
|
$this->assign('statusList', self::$statusList);
|
|
|
|
$this->assign('reviewRule', $reviewRule);
|
|
|
|
$this->assign('reviewRule', $reviewRule);
|
|
|
|
$this->assign('is_admin', is_administrator());
|
|
|
|
$this->assign('is_admin', is_administrator());
|
|
|
|
$this->meta_title = '公会分成管理';
|
|
|
|
$this->meta_title = $metaTitle;
|
|
|
|
$this->display();
|
|
|
|
$this->display();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -236,8 +247,10 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$save['id'] = intval($params['id']);
|
|
|
|
$save['id'] = intval($params['id']);
|
|
|
|
$result = D(self::MODEL_NAME)->save($save);
|
|
|
|
$result = D(self::MODEL_NAME)->save($save);
|
|
|
|
|
|
|
|
$logResult = $result;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$result = true;
|
|
|
|
$result = true;
|
|
|
|
|
|
|
|
$logResult = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {//新增
|
|
|
|
} else {//新增
|
|
|
|
if (empty($params['promote_id'])) {
|
|
|
|
if (empty($params['promote_id'])) {
|
|
|
@ -264,14 +277,27 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$save['promote_id'] = $promoteId;
|
|
|
|
$save['promote_id'] = $promoteId;
|
|
|
|
$save['game_id'] = $gameId;
|
|
|
|
$save['game_id'] = $gameId;
|
|
|
|
|
|
|
|
$save['last_turnover_ratio'] = '';
|
|
|
|
$save['applicant_id'] = is_login();
|
|
|
|
$save['applicant_id'] = is_login();
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
$result = D(self::MODEL_NAME)->add($save);
|
|
|
|
$result = D(self::MODEL_NAME)->add($save);
|
|
|
|
|
|
|
|
$logResult = $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($result === false) {
|
|
|
|
if ($result === false) {
|
|
|
|
$this->error('保存失败');
|
|
|
|
$this->error('保存失败');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if ($logResult) {
|
|
|
|
|
|
|
|
if (empty($params['id'])) {
|
|
|
|
|
|
|
|
$promoteGameRatioId = $result;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$promoteGameRatioId = $params['id'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$model = new PromoteGameRatioModel();
|
|
|
|
|
|
|
|
$model->addLog($promoteGameRatioId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->success('保存成功', U('lists'));
|
|
|
|
$this->success('保存成功', U('lists'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -351,8 +377,10 @@ class PromoteGameRatioController extends ThinkController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$result = D(self::MODEL_NAME)->where($map)->save($save);
|
|
|
|
$result = D(self::MODEL_NAME)->where($map)->save($save);
|
|
|
|
if ($result) {
|
|
|
|
if ($result) {
|
|
|
|
if ($status == 1) {
|
|
|
|
$model = new PromoteGameRatioModel();
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
|
|
|
|
$model->addLog($id);
|
|
|
|
|
|
|
|
if ($status == 1) {
|
|
|
|
$promoteGameRatio = D(self::MODEL_NAME)->find($id);
|
|
|
|
$promoteGameRatio = D(self::MODEL_NAME)->find($id);
|
|
|
|
if (!empty($promoteGameRatio)) {
|
|
|
|
if (!empty($promoteGameRatio)) {
|
|
|
|
if ($promoteGameRatio['begin_time'] <= strtotime(date('Y-m-d', time()))) {
|
|
|
|
if ($promoteGameRatio['begin_time'] <= strtotime(date('Y-m-d', time()))) {
|
|
|
|