解决冲突

master
ELF 5 years ago
commit 0f44d9e95c

@ -28,7 +28,7 @@ return array(
'DOWNLOAD_UPLOAD' => array(
'mimes' => '', //允许上传的文件MiMe类型
'maxSize' => 0, //上传的文件大小限制 (0-不做限制)
'exts' => 'jpg,gif,png,jpeg,zip,rar,tar,gz,7z,doc,docx,txt,xml,mp4', //允许上传的文件后缀
'exts' => 'jpg,gif,png,jpeg,zip,rar,tar,gz,7z,doc,docx,txt,xml,mp4,xlsx', //允许上传的文件后缀
'autoSub' => true, //自动子目录保存文件
'subName' => array('date', 'Y-m-d'), //子目录创建方式,[0]-函数名,[1]-参数,多个参数使用数组
'rootPath' => './Uploads/Download/', //保存根路径

@ -8,6 +8,7 @@
*/
namespace Admin\Controller;
use Admin\Model\SpendModel;
use Admin\Model\WithdrawModel;
use Think\Think;
use Org\RedisSDK\Redis;
@ -1034,4 +1035,94 @@ public function auto_rrdae(){
];
return $ret;
}
//会长周结--初始化
public function promoteWithdrawWeeklyInitial()
{
$this->promoteWithdraw(1, true);
}
//会长月结--初始化
public function promoteWithdrawPerMonthInitial()
{
$this->promoteWithdraw(2, true);
}
//会长周结
public function promoteWithdrawWeekly()
{
$this->promoteWithdraw(1);
}
//会长月结
public function promoteWithdrawPerMonth()
{
$this->promoteWithdraw(2);
}
//会长周结月补点
public function promoteWithdrawRecoup()
{
$this->promoteWithdraw(3);
}
//会长提现 $settlement 1-周结算 2-月结算
private function promoteWithdraw($settlement = 1, $initial = false)
{
$withdrawModel = new WithdrawModel();
$map['id'] = 84;
$map['level'] = 1;
$map['ver_status'] = 1;
$map['settlement_type'] = ($settlement == 3) ? 1 : $settlement;
$promotes = M('promote', 'tab_')->field('id, account, chain, settlement_type')->where($map)->select();
$success = 0;
$error_withdraw = 0;
$error_spend = 0;
$error_balance = 0;
$error_unset = 0;
$error_repeat = 0;
if (!empty($promotes)) {
switch ($settlement) {
case 1:
$fun = 'promoteWithdrawWeeklyByPromote';
break;
case 2:
$fun = 'promoteWithdrawPerMonthByPromote';
break;
case 3:
$fun = 'promoteWithdrawRecoupByPromote';
break;
}
foreach ($promotes as $promote) {
if ($fun == 'promoteWithdrawRecoupByPromote') {
$result = $withdrawModel->$fun($promote);
} else {
$result = $withdrawModel->$fun($promote, $initial);
}
switch ($result) {
case -4:
$error_repeat++;
break;
case -3:
$error_unset++;
break;
case -2:
$error_balance++;
break;
case -1:
$error_spend++;
break;
case 0:
$error_withdraw++;
break;
case 1:
$success++;
break;
}
}
}
echo "success{$success} error_withdraw{$error_withdraw} error_spend{$error_spend} error_balance{$error_balance} error_unset{$error_unset} error_repeat{$error_repeat}";
}
}

@ -339,7 +339,10 @@ class PromoteController extends ThinkController
$data['company_belong'] = I('company_belong');//工会归属
$data['company_relation'] = I('company_relation');//工会关系
}
$settlementType = intval(I('settlement_type', 1));
if (!empty(I('settlement_type')) && in_array($settlementType, [1, 2])) {
$data['settlement_type'] = $settlementType;
}
$res = M("promote", "tab_")->where(array("id"=>$_POST['id']))->save($data);
if ($res !== false) {
if ($promote['level'] == 1) {//修改会长底下推广员的推广公司

@ -3,6 +3,7 @@
namespace Admin\Controller;
use Think\Controller;
use Admin\Model\PromoteGameRatioModel;
class PromoteGameRatioController extends ThinkController
{
@ -20,6 +21,7 @@ class PromoteGameRatioController extends ThinkController
public function lists()
{
$params = I('get.');
$group = $params['group'] ?? 1;
$promoteId = $params['promote_id'] ?? 0;
$gameId = $params['game_id'] ?? 0;
$status = $params['status'] ?? '';
@ -38,12 +40,24 @@ class PromoteGameRatioController extends ThinkController
}
$field = 'create_time, update_time';
$promoteGameRatios = D(self::MODEL_NAME)->field($field, true)
->where($map)
->page($page, $row)
->order('update_time desc, id desc')
->select();
$count = D(self::MODEL_NAME)->where($map)->count();
if ($group == 1) {
$query = D(self::MODEL_NAME)->field($field, true)
->where($map)
->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) {
$query->page($page, $row);
}
$promoteGameRatios = $query->select();
if (I('export', 0) != 1) {
$count = D(self::MODEL_NAME)->where($map)->count();
}
$records = [];
if ($promoteGameRatios) {
@ -62,34 +76,39 @@ class PromoteGameRatioController extends ThinkController
$thisPromoteAccount = '未知';
$thisPromoteMobilePhone = '未知';
$thisPromoteCreateTime = '未知';
$thisPromoteStatus = '未知';
$thisPromoteStatus = '待审核';
$thisPromoteVerStatus = '未知';
$thisGameName = '未知';
$thisGameRatio = '0.00';
$thisLastRatio = $promoteGameRatio['last_ratio'];
$thisGameRatio = '0.00%';
$thisLastRatio = $promoteGameRatio['last_ratio'] . '%';
$thisLastTurnoverRatio = $promoteGameRatio['last_turnover_ratio'] ? json_decode($promoteGameRatio['last_turnover_ratio'], true) : [];
$thisLastRatio = $thisLastTurnoverRatio ? "{$thisLastRatio} - " . $thisLastTurnoverRatio[count($thisLastTurnoverRatio) - 1]['ratio'] . '%' : $thisLastRatio;
$thisRatio = $promoteGameRatio['ratio'] . '%';
$thisTurnoverRatio = $promoteGameRatio['turnover_ratio'] ? json_decode($promoteGameRatio['turnover_ratio'], true) : [];
$thisRatio = $thisTurnoverRatio ? "{$thisRatio} - " . $thisTurnoverRatio[count($thisTurnoverRatio) - 1]['ratio'] . '%' : $thisRatio;
$thisLastRatioStatus = $promoteGameRatio['last_ratio_status'];
$thisStatusText = self::$statusList[$promoteGameRatio['status']];
$thisStatusText = ($promoteGameRatio['status'] == -1) ? '<span style="color: red;">' . $thisStatusText . '</span>' : $thisStatusText;
$thisApplicant = get_admin_account($promoteGameRatio['applicant_id']);
$thisReviewer = $promoteGameRatio['reviewer_id'] ? get_admin_account($promoteGameRatio['reviewer_id']) : '待确认';
$thisBeninTime = date('Y/m/d', $promoteGameRatio['begin_time']);
$thisEndTime = $promoteGameRatio['end_time'] ? date('Y/m/d', $promoteGameRatio['end_time']) : '永久';
$thisBeninTime = date('Y/m', $promoteGameRatio['begin_time']);
$thisEndTime = $promoteGameRatio['end_time'] ? date('Y/m', $promoteGameRatio['end_time']) : '永久';
$validDate = $thisBeninTime . ' - ' . $thisEndTime;
if ($issetPromote) {
$thisPromoteAccount = $promotes[$thisPromoteId]['account'];
$thisPromoteMobilePhone = $promotes[$thisPromoteId]['mobile_phone'];
$thisPromoteCreateTime = date('Y-m-d H:i:s', $promotes[$thisPromoteId]['create_time']);
$thisPromoteStatus = get_status_title($promotes[$thisPromoteId]['status']);
$thisPromoteStatus = $thisPromoteStatus ?? '未知';
$thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['status'], 2);
$thisPromoteStatus = get_info_status($promotes[$thisPromoteId]['status'], 3);
$thisPromoteStatus = $thisPromoteStatus ?? '待审核';
$thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['ver_status'], 2);
}
if ($issetGame) {
$thisGameName = $games[$thisGameId]['game_name'];
$thisGameRatio = $games[$thisGameId]['ratio'];
$thisGameRatio = $thisGameRatio ?? '0.00';
$thisGameRatio = ($thisGameRatio ?? '0.00') . '%';
}
$records[] = [
$record = [
'id' => $promoteGameRatio['id'],
'promote_id' => $promoteGameRatio['promote_id'],
'promote_account' => $thisPromoteAccount,
@ -98,27 +117,56 @@ class PromoteGameRatioController extends ThinkController
'promote_status_text' => $thisPromoteStatus,
'promote_ver_status_text' => $thisPromoteVerStatus,
'game_name' => $thisGameName,
'last_ratio' => (($thisLastRatioStatus == 1) ? $thisLastRatio : $thisGameRatio) . '%',
'ratio' => $promoteGameRatio['ratio'] . '%',
'last_ratio' => (($thisLastRatioStatus == 1 || $group != 1) ? $thisLastRatio : $thisGameRatio),
'ratio' => $thisRatio,
'valid_date' => $validDate,
'remark' => $promoteGameRatio['remark'],
'status' => $promoteGameRatio['status'],
'status_text' => $thisStatusText,
'applicant' => $thisApplicant ?? '未知',
'reviewer' => $thisReviewer ?? '未知',
];
if (I('export', 0) != 1) {
$record['status'] = $promoteGameRatio['status'];
}
$records[] = $record;
}
}
$reviewRule = $this->getReviewRule();
if (I('export', 0) == 1) {
$field = [
'promote_id' => '会长Id',
'promote_account' => '会长账号',
'promote_mobile_phone' => '手机号码',
'promote_create_time' => '注册时间',
'promote_status_text' => '状态',
'promote_ver_status_text' => '身份状态',
'game_name' => '已申请游戏',
'last_ratio' => '原分成比例',
'ratio' => '当前分成比例',
'valid_date' => '开始时间',
'remark' => '备注',
'status_text' => '分成比例审核',
'applicant' => '申请人',
'reviewer' => '确认人',
];
data2csv($records,$csvTitle, $field);
exit;
}
$reviewRule = $this->getReviewRule();
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
$this->assign('group', $group);
$this->assign('records', $records);
$this->assign('count', $count);
$this->assign('gameList', getAllGameList());
$this->assign('promoteList', getPromoteByLevel(1));
$this->assign('statusList', self::$statusList);
$this->assign('reviewRule', $reviewRule);
$this->meta_title = '公会分成管理';
$this->assign('is_admin', is_administrator());
$this->meta_title = $metaTitle;
$this->display();
}
@ -135,9 +183,52 @@ class PromoteGameRatioController extends ThinkController
$this->error('结束时间不得小于开始时间');
}
}
if (!isset($params['ratio']) || $params['ratio'] === '') {
$this->error('默认分成比例不能为空');
}
$save['turnover_ratio'] = [];
if (!empty(array_filter($params['turnover'])) || !empty(array_filter($params['turnover_ratio']))) {
if (is_array($params['turnover']) && is_array($params['turnover_ratio'])) {
foreach ($params['turnover'] as $turnover) {
if (empty($turnover)) {
$this->error('月流水不能为空');
}
}
foreach ($params['turnover_ratio'] as $turnoverRatio) {
if (empty($turnoverRatio)) {
$this->error('月流水分成比例不能为空');
}
}
$turnoverCount = count($params['turnover']);
$sortTurnover = $params['turnover'];
sort($sortTurnover);
if ($params['turnover'] != $sortTurnover || $turnoverCount != count(array_unique($params['turnover']))) {
$this->error('月流水必须以正序的方式填写,且必须大于上一个月流水');
}
$ratio = $params['ratio'] ?? 0;
if ($params['turnover_ratio'][0] <= $ratio) {
$this->error('月流水分成比例必须大于默认分成比例');
}
$turnoverRatioCount = count($params['turnover_ratio']);
$sortTurnoverRatio = $params['turnover_ratio'];
sort($sortTurnoverRatio);
if ($params['turnover_ratio'] != $sortTurnoverRatio || $turnoverRatioCount != count(array_unique($params['turnover_ratio']))) {
$this->error('月流水分成比例必须以正序的方式填写,且必须大于上一个月流水分成比例');
}
foreach ($params['turnover'] as $key => $turnover) {
$save['turnover_ratio'][] = [
'turnover' => bcdiv($turnover, 1, 2),
'ratio' => bcdiv($params['turnover_ratio'][$key], 1, 2),
];
}
$save['turnover_ratio'] = json_encode($save['turnover_ratio']);
}
}
$save['ratio'] = $params['ratio'] ?? 0;
$save['begin_time'] = strtotime($params['begin_time']);
$save['end_time'] = $params['end_time'] ? strtotime($params['end_time']) : 0;
$save['end_time'] = $params['end_time'] ? (strtotime('+1 month', strtotime($params['end_time'])) - 1) : 0;
$save['remark'] = $params['remark'] ?? '';
$save['status'] = 0;
$save['update_time'] = $time;
@ -146,16 +237,21 @@ class PromoteGameRatioController extends ThinkController
if (empty($promoteGameRatio)) {
$this->error('参数异常');
}
if ($promoteGameRatio['status'] == -1 || $save['begin_time'] != $promoteGameRatio['begin_time'] || $save['end_time'] != $promoteGameRatio['end_time'] || $save['ratio'] != $promoteGameRatio['ratio'] || $save['remark'] != $promoteGameRatio['remark'] || $save['turnover_ratio'] != $promoteGameRatio['turnover_ratio']) {
$this->isWithdraw($promoteGameRatio['promote_id'], $save['begin_time']);
$promoteId = $promoteGameRatio['promote_id'];
$this->isWithdraw($promoteId, $save['begin_time']);//是否存在开始时间后已提现数据
if ($promoteGameRatio['status'] == 1) {
$save['last_ratio'] = $promoteGameRatio['ratio'];
$save['last_ratio_status'] = 1;
if ($promoteGameRatio['status'] == 1) {
$save['last_turnover_ratio'] = $promoteGameRatio['turnover_ratio'];
$save['last_ratio'] = $promoteGameRatio['ratio'];
$save['last_ratio_status'] = 1;
}
$save['id'] = intval($params['id']);
$result = D(self::MODEL_NAME)->save($save);
$logResult = $result;
} else {
$result = true;
$logResult = false;
}
$save['id'] = intval($params['id']);
$result = D(self::MODEL_NAME)->save($save);
} else {//新增
if (empty($params['promote_id'])) {
$this->error('请选择会长账号');
@ -165,13 +261,14 @@ class PromoteGameRatioController extends ThinkController
}
$promoteId = intval($params['promote_id']);
$gameId = intval($params['game_id']);
$this->isWithdraw($promoteId, $save['begin_time']);//是否存在开始时间后已提现数据
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote) || $promote['level'] != 1) {
$this->error('参数异常');
}
$this->isWithdraw($promoteId, $save['begin_time']);
$map['promote_id'] = $promoteId;
$map['game_id'] = $gameId;
$promoteGameRatio = D(self::MODEL_NAME)->where($map)->find();
@ -180,14 +277,27 @@ class PromoteGameRatioController extends ThinkController
}
$save['promote_id'] = $promoteId;
$save['game_id'] = $gameId;
$save['last_turnover_ratio'] = '';
$save['applicant_id'] = is_login();
$save['create_time'] = $time;
$result = D(self::MODEL_NAME)->add($save);
$logResult = $result;
}
if ($result === false) {
$this->error('保存失败');
} else {
if ($logResult) {
if (empty($params['id'])) {
$promoteGameRatioId = $result;
} else {
$promoteGameRatioId = $params['id'];
}
$model = new PromoteGameRatioModel();
$model->addLog($promoteGameRatioId);
}
$this->success('保存成功', U('lists'));
}
} else {
@ -202,10 +312,11 @@ class PromoteGameRatioController extends ThinkController
if (empty($promoteGameRatio)) {
$this->error('数据异常');
}
$promoteGameRatio['begin_time'] = $promoteGameRatio['begin_time'] ? date('Y-m-d', $promoteGameRatio['begin_time']) : '';
$promoteGameRatio['end_time'] = $promoteGameRatio['end_time'] ? date('Y-m-d', $promoteGameRatio['end_time']) : '';
$promoteGameRatio['begin_time'] = $promoteGameRatio['begin_time'] ? date('Y-m', $promoteGameRatio['begin_time']) : '';
$promoteGameRatio['end_time'] = $promoteGameRatio['end_time'] ? date('Y-m', $promoteGameRatio['end_time']) : '';
$promoteGameRatio['turnover_ratio'] = $promoteGameRatio['turnover_ratio'] ? json_decode($promoteGameRatio['turnover_ratio'], true) : $promoteGameRatio['turnover_ratio'];
if ($promoteGameRatio['last_ratio_status'] == 1) {
$lastRatio = $promoteGameRatio['last_ratio'];
$lastRatio = $promoteGameRatio['last_ratio'] . '%';
} else {
$gameRatio = M('game', 'tab_')->where(array(['id' => $promoteGameRatio['game_id']]))->getField('ratio');
$lastRatio = ($gameRatio ?? '0.00') . '%';
@ -234,11 +345,11 @@ class PromoteGameRatioController extends ThinkController
$withdrawMap['promote_id'] = $promoteId;
$withdrawMap['status'] = ['neq', -2];
$withdrawMap['settlement_end_time'] = ['egt', $beginTime];
$withdrawMap['settlement_begin_time'] = ['egt', $beginTime];
$withdraw = M('withdraw', 'tab_')->where($withdrawMap)->order('create_time desc')->find();
if (!empty($withdraw) && $withdraw['status'] != -2) {
$time = date('Y-m-d', $withdraw['create_time']);
$this->error("{$time}之前的订单已经申请提现, 无法变更分成比例,请重新选择开始时间");
$time = date('Y-m', $beginTime);
$this->error("{$time}月已有订单申请提现, 无法变更分成比例,请重新选择开始时间");
}
}
@ -266,8 +377,10 @@ class PromoteGameRatioController extends ThinkController
}
$result = D(self::MODEL_NAME)->where($map)->save($save);
if ($result) {
if ($status == 1) {
foreach ($ids as $id) {
$model = new PromoteGameRatioModel();
foreach ($ids as $id) {
$model->addLog($id);
if ($status == 1) {
$promoteGameRatio = D(self::MODEL_NAME)->find($id);
if (!empty($promoteGameRatio)) {
if ($promoteGameRatio['begin_time'] <= strtotime(date('Y-m-d', time()))) {

@ -2,7 +2,9 @@
namespace Admin\Controller;
use Home\Controller\FileController;
use User\Api\UserApi as UserApi;
use Admin\Model\WithdrawModel;
/**
* 推广查询控制器
@ -10,164 +12,511 @@ use User\Api\UserApi as UserApi;
*/
class QueryController extends ThinkController
{
public function settlement($p = 0)
//生成提现单号
public function produceWithdrawNumber()
{
$prefix = 'WD_';
$number = '';
while (true) {
$randomNum = rand(10, 99);
$number = $prefix . time() . $randomNum;
$map['widthdraw_number'] = $number;
$res = M('withdraw', 'tab_')->where($map)->getField('id');
if (!$res) {
break;
}
}
return $number;
}
public function settlement($p = 0)
{
$settlementType = intval(I('settlement_type', 0));
$settlementTypeList = WithdrawModel::$settlementTypeList;
$page = intval(I('p', 1)); //默认显示第一页数据
$row = intval(I('row', 10));
$group = I('group', 1);
$this->assign('group', $group);
if (isset($_REQUEST['total_status'])) {
unset($_REQUEST['total_status']);
}
$this->m_title = '推广结算';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Query/settlement', 'status' => 1])->find());
$this->assign('is_admin', is_administrator());
$promoteId = I('promote_id', 0);
if ($group == 1) {
if ($_REQUEST['unum'] == 2) {
$order = 'unum';
$order_type = SORT_ASC;
} else if ($_REQUEST['unum'] == 1) {
$order = 'unum';
$order_type = SORT_DESC;
}
if ($_REQUEST['spay_amount'] == 2) {
$order = 'spay_amount';
$order_type = SORT_ASC;
} else if ($_REQUEST['spay_amount'] == 1) {
$order = 'spay_amount';
$order_type = SORT_DESC;
}
$model = array(
'title' => '渠道结算',
'template_list' => 'settlement',
'order' => $order,
'order_type' => $order_type//0倒序 1 正序
);
$start = $_REQUEST['timestart'];
$end = $_REQUEST['timeend'];
if (I('group') != '') {
if ($start == '' || $end == '' && $_REQUEST['promote_account'] == '') {
$this->error('结算周期、所属渠道不能为空!', '', 1);
unset($settlementTypeList[WithdrawModel::SETTLEMENT_TYPE_OTHER]);
$time = I('time', '');
if (empty($promoteId) || empty($settlementType) || empty($time)) {
$this->assign('settlementTypeList', $settlementTypeList);
$this->display();
} else {
$promoteIds = M('promote', 'tab_')->where(['chain' => ['like', "/{$promoteId}/%"]])->getField('id', true);
$promoteIds[] = $promoteId;
if ($settlementType == 1) {
$time = explode(' 至 ', $time);
if (count($time) != 2) {
$this->display();die;
}
$beginTime = strtotime($time[0]);
$endTime = strtotime($time[1]) + 3600 * 24 - 1;
} else {
$beginTime = strtotime($time);
$endTime = strtotime('+1 month', $beginTime) - 1;
}
if ($start == '' || $end == '') {
$this->error('请选择结算周期!', '', 1);
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote) || $promote['level'] != 1 || empty($promote['settlement_type'])) {
$this->error('网络异常');
}
if ($_REQUEST['promote_account'] == '') {
$this->error('请选择渠道!', '', 1);
if ($promote['settlement_type'] == 1) {
unset($settlementTypeList[WithdrawModel::SETTLEMENT_TYPE_MONTH]);
} else {
unset($settlementTypeList[WithdrawModel::SETTLEMENT_TYPE_WEEK]);
unset($settlementTypeList[WithdrawModel::SETTLEMENT_TYPE_RECOUP]);
}
if ($settlementType == 3) {
$withdrawMap['promote_id'] = $promoteId;
$withdrawMap['status'] = ['neq', -2];
$withdrawMap['settlement_begin_time'] = $beginTime;
$withdrawMap['settlement_end_time'] = $endTime;
$withdraw = D('withdraw')->where($withdrawMap)->find();
if (!empty($withdraw)) {
$this->assign('settlementTypeList', $settlementTypeList);
$this->display();die;
}
} else {
$spendMap['tab_spend.selle_status'] = 0;
}
$sortBy = I('sort_by', '');
$sortColumn = I('sort_column', '');
$order = 'day';
$orderType = 'desc';
if (in_array($sortColumn, ['user_num', 'sum_amount'])) {
$order = $sortColumn;
}
if ($sortBy == 1) {
$orderType = 'desc';
} elseif ($sortBy == 2) {
$orderType = 'asc';
}
}
$smap['tab_spend.pay_status'] = 1;
//判断是否结算绑币
if ($_REQUEST['bind_coin'] == 0) {
$smap['tab_spend.pay_way'] = array('neq', -1);
}
$this->meta_title = '渠道结算列表';
$this->assign('setdate', date("Y-m-d", strtotime("-1 day")));
$this->assign('is_admin', is_administrator());
if ($start && $end) {
if ((strtotime($end) + 24 * 60 * 60 - 1) < strtotime($start)) {
$this->error('时间选择不正确!', U('Query/settlement'), '');
$spendMap['tab_spend.pay_status'] = 1;
$spendMap['tab_spend.pay_time'] = ['between', [$beginTime, $endTime]];
$spendMap['tab_spend.promote_id'] = ['in', $promoteIds];
$spendField = "tab_spend.game_id, tab_spend.game_name, sum(tab_spend.pay_amount) as sum_amount, tab_spend.selle_ratio, sum(if(tab_spend.selle_ratio > 0, tab_spend.pay_amount * tab_spend.selle_ratio, 0)) as settlement_amount, FROM_UNIXTIME(tab_spend.`pay_time`, '%Y-%m-%d') as day";
$userMap['tab_user.promote_id'] = ['in', $promoteIds];
$userMap['_string'] = 'tab_user.promote_id = tab_spend.promote_id';
$userField = M('user', 'tab_')->field('count(tab_user.id) as user_num')
->where($userMap)
->buildSql();
$field = "{$spendField}, {$userField} as user_num";
$query = M('spend', 'tab_')->field($field)
->where($spendMap)
->group('tab_spend.selle_ratio, tab_spend.game_id, day')
->order("{$order} {$orderType}");
if(I('export', 0) != 1){
$query->page($page, $row);
}
$umap['register_time'] = array('BETWEEN', array(strtotime($start), strtotime($end) + 24 * 60 * 60 - 1));
if (isset($_REQUEST['game_name']) && $_REQUEST['game_name'] != '') {
$umap['fgame_id'] = get_game_id($_REQUEST['game_name']);
$smap['tab_spend.game_id'] = get_game_id($_REQUEST['game_name']);
$records = M()->table($query->buildSql())
->alias('record')
->select();
if(I('export', 0) != 1){
$countQuery = M('spend', 'tab_')->field($spendField)
->where($spendMap)
->group('tab_spend.selle_ratio, tab_spend.game_id, day')
->buildSql();
$count = M()->table($countQuery)
->alias('tab_spend')
->count();
$page = set_pagination($count, $row);
}
if (isset($_REQUEST['promote_account']) && $_REQUEST['promote_account'] != '') {
$allid = get_subordinate_promote_($_REQUEST['promote_account']);
$allid[] = $_REQUEST['promote_account'];
$umap['tab_user.promote_account'] = array('in', $allid);
$smap['tab_spend.promote_account'] = array('in', $allid);
if (!empty($records)) {
foreach ($records as &$record) {
$record['promote_account'] = $promote['account'] ?? '未知';
$record['settlement_amount'] = bcdiv($record['settlement_amount'], 100, 2);
}
}
if ($settlementType != 3) {
$totalField = 'sum(if(tab_spend.selle_ratio > 0, tab_spend.pay_amount * tab_spend.selle_ratio, 0)) as settlement_amount';
$zTotal = null_to_0(M('spend', 'tab_')->field($totalField)->where($spendMap)->find()['settlement_amount']);//累计
$zTotal = bcdiv($zTotal, 100 ,2);
} else {
$this->error('未选择渠道!', '', 1);
$spendMap['game_id'] = 157;
$totalField = 'sum(tab_spend.pay_amount) as sum_amount';
$zTotal = null_to_0(M('spend', 'tab_')->field($totalField)->where($spendMap)->find()['sum_amount']);//累计
}
$umap['is_check'] = 1;
$umap['settle_check'] = 0;
$smap['pay_time'] = array('BETWEEN', array(strtotime($start), strtotime($end) + 24 * 60 * 60 - 1));
$smap['is_check'] = 1;
$smap['settle_check'] = 0;
//为数据权限添加
setPowerPromoteIds($umap, 'tab_user.promote_id');
setPowerPromoteIds($smap, 'tab_spend.promote_id');
$map['umap'] = $umap;
$map['smap'] = $smap;
$user = A('Settlement', 'Event');
if(I('export', 0) == 1) {
$data = [];
foreach ($records as $value) {
$data[] = [
'day' => $value['day'],
'promote_account' => $value['promote_account'],
'game_name' => $value['game_name'],
'sum_amount' => $value['sum_amount'],
'user_num' => $value['user_num'],
'type' => 'CPS',
'selle_ratio' => $value['selle_ratio'] . '%',
'settlement_amount' => $value['settlement_amount'],
];
}
$field = [
'day' => '日期',
'promote_account' => '会长账号',
'game_name' => '游戏名称',
'sum_amount' => '总充值',
'user_num' => '总注册',
'type' => '结算模式',
'selle_ratio' => '分成比例',
'settlement_amount' => '结算金额',
];
data2csv($data,"推广结算", $field);
exit;
}
$user->settlement($model, $p, $map);
} else {
if($page) {
$this->assign('_page', $page);
}
$this->assign('settlementTypeList', $settlementTypeList);
$this->assign('records', $records);
$this->assign('zTotal', $zTotal);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Query/settlement', 'status' => 1])->find());
$this->m_title = '推广结算';
$this->display();
}
}
if ($group == 2) {
if (isset($_REQUEST['stimestart']) && isset($_REQUEST['stimeend'])) {
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['stimestart']), strtotime($_REQUEST['stimeend']) + 24 * 60 * 60 - 1));
} elseif (isset($_REQUEST['stimestart'])) {
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['stimestart']), time()));
} elseif (isset($_REQUEST['stimeend'])) {
$map['create_time'] = array('LT', (strtotime($_REQUEST['stimeend']) + 24 * 60 * 60 - 1));
} elseif ($group == 2) {
$map['_string'] = '1 = 1';
$createTime = strtotime(I('create_time', ''));
$withdrawNumber = I('widthdraw_number', '');
$status = intval(I('status', ''));
$opType = intval(I('op_type', 0));
if ($createTime) {
$createTimeEnd = $createTime + 3600 * 24 - 1;
$map['create_time'] = ['between', [$createTime, $createTimeEnd]];
}
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$map['starttime'] = ['GT', strtotime($_REQUEST['timestart'])];
$map['endtime'] = ['LT', strtotime($_REQUEST['timeend']) + 24 * 60 * 60];
} elseif (isset($_REQUEST['timestart'])) {
$map['starttime'] = ['GT', strtotime($_REQUEST['timestart'])];
} elseif (isset($_REQUEST['timeend'])) {
$map['endtime'] = ['LT', strtotime($_REQUEST['timeend']) + 24 * 60 * 60];
if ($promoteId) {
$map['promote_id'] = $promoteId;
}
if (isset($_REQUEST['game_name'])) {
if ($_REQUEST['game_name'] == '全部') {
unset($_REQUEST['game_name']);
} else {
$map['game_name'] = $_REQUEST['game_name'];
if ($withdrawNumber) {
$map['widthdraw_number'] = ['like', "{$withdrawNumber}%"];
}
if (isset($_REQUEST['status'])) {
$map['status'] = $status;
}
if ($opType) {
$map['op_type'] = $opType;
}
if ($settlementType) {
$map['settlement_type'] = $settlementType;
}
$query = M('withdraw', 'tab_')->field('id, promote_account, widthdraw_number, sum_money, op_id, op_type, last_op_id, last_op_type, settlement_begin_time, settlement_end_time, create_time, status, respond, settlement_type')
->where($map)
->order('create_time desc');
if(I('export', 0) != 1){
$query->page($page, $row);
}
$records = $query->select();
if(I('export', 0) != 1){
$count = M('withdraw', 'tab_')->field('id, promote_account, widthdraw_number, sum_money, op_id, op_type, last_op_id, last_op_type, settlement_begin_time, settlement_end_time, create_time, status, respond')
->where($map)
->count();
}
if (!empty($records)) {
foreach ($records as &$record) {
$record['settlement_begin_time'] = $record['settlement_begin_time'] ? date('Y-m-d H:i:s', $record['settlement_begin_time']) : '--';
$record['settlement_end_time'] = date('Y-m-d H:i:s', $record['settlement_end_time']);
$record['create_time'] = date('Y-m-d H:i:s', $record['create_time']);
$record['status_text'] = promoteWithdrawStatus($record['status']);
if ($record['status'] == -2) {
$record['status_text'] = '<span style="color: #999;">' . $record['status_text'] . '</span>';
}
$record['op_id_text'] = $this->getOpTypeText($record['op_type'], $record['op_id']);
$record['last_op_id_text'] = $this->getOpTypeText($record['last_op_type'], $record['last_op_id']);
$record['op_type_text'] = getPromoteWithdrawOpType($record['op_type']);
$record['last_op_type_text'] = getPromoteWithdrawOpType($record['last_op_type']);
$record['settlement_type_text'] = getPromoteWithdrawSettlementType($record['settlement_type']);
}
}
if (isset($_REQUEST['promote_account'])) {
if ($_REQUEST['promote_account'] == '全部') {
unset($_REQUEST['promote_account']);
} else {
$map['promote_account'] = $_REQUEST['promote_account'];
if(I('export', 0) == 1) {
$data = [];
foreach ($records as $value) {
$data[] = [
'promote_account' => $value['promote_account'],
'widthdraw_number' => $value['widthdraw_number'],
'sum_money' => $value['sum_money'],
'op_id_text' => $value['op_id_text'],
'op_type_text' => $value['op_type_text'],
'last_op_id_text' => $value['last_op_id_text'],
'last_op_type_text' => $value['last_op_type_text'],
'settlement_type_text' => $value['settlement_type_text'],
'settlement_begin_time' => $value['settlement_begin_time'],
'settlement_end_time' => $value['settlement_end_time'],
'create_time' => $value['create_time'],
'status_text' => promoteWithdrawStatus($value['status']),
'respond' => $value['respond'],
];
}
$field = [
'promote_account' => '推广员账号',
'widthdraw_number' => '结算单号',
'sum_money' => '结算金额',
'op_id_text' => '操作人',
'op_type_text' => '操作人类型',
'last_op_id_text' => '最后操作人',
'last_op_type_text' => '最后操作人类型',
'settlement_type_text' => '提现模式',
'settlement_begin_time' => '结算开始时间',
'settlement_end_time' => '结算截止时间',
'create_time' => '提现时间',
'status_text' => '提现状态',
'respond' => '说明',
];
data2csv($data,"推广结算", $field);
exit;
}
if (!empty($_REQUEST['settlement_number'])) {
$map['settlement_number'] = $_REQUEST['settlement_number'];
$page = set_pagination($count, $row);
if($page) {
$this->assign('_page', $page);
}
$this->assign('settlementTypeList', $settlementTypeList);
$this->assign('records', $records);
$this->display();
}
}
$map['developers'] = 0;
private function getOpTypeText($type, $id)
{
switch ($type) {
case 1:
return get_promote_name($id);
break;
case 2:
return getAdminNickname($id);
break;
default:
return '自动';
break;
}
}
$model = array(
'm_name' => 'settlement',
'fields' => array(
'settlement_number',
'starttime', 'endtime',
'promote_id', 'promote_account',
'sum(total_money) as total_money',
'sum(total_number) as total_number',
'sum(sum_money) as sum_money',
'bind_coin_status',
'create_time'),
'group' => 'promote_id,starttime,endtime,create_time,bind_coin_status',
'order' => 'create_time desc ',
'title' => '结算账单',
'template_list' => 'settlement',
);
//为数据权限添加
setPowerPromoteIds($map);
$map1 = $map;
public function settlementWithdraw()
{
$promoteId = intval(I('promote_id', 0));
$settlementType = intval(I('settlement_type', 0));
$time = I('time', '');
if (empty($promoteId)) {
$data['status'] = 0;
$data['msg'] = '请选择会长账号';
$this->ajaxReturn($data);
}
if (empty($settlementType)) {
$data['status'] = 0;
$data['msg'] = '请选择提现模式';
$this->ajaxReturn($data);
}
if (empty($time)) {
$data['status'] = 0;
$data['msg'] = '请选择充值时间';
$this->ajaxReturn($data);
}
$ztotal = null_to_0(D('settlement')->where($map1)->sum('sum_money*10000') / 10000);
$this->assign('ztotal', $ztotal);
$ttotal = null_to_0(D('settlement')->where('create_time' . total(1))->sum('sum_money*10000') / 10000);
$this->assign('ttotal', $ttotal);
$ytotal = null_to_0(D('settlement')->where('create_time' . total(5))->sum('sum_money*10000') / 10000);
$this->assign('ytotal', $ytotal);
$user = A('Bill', 'Event');
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote)) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
if ($promote['level'] != 1) {
$data['status'] = 0;
$data['msg'] = '非会长账号,无法执行此操作';
$this->ajaxReturn($data);
}
if ($promote['ver_status'] != 1) {
$data['status'] = 0;
$data['msg'] = '该会长未通过资质认证审核,暂时无法提现';
$this->ajaxReturn($data);
}
if ($promote['settlement_type'] == 1) {
if (!in_array($settlementType, [1, 3])) {
$data['status'] = 0;
$data['msg'] = '参数异常';
$this->ajaxReturn($data);
}
} else {
if ($settlementType != 2) {
$data['status'] = 0;
$data['msg'] = '参数异常';
$this->ajaxReturn($data);
}
}
$user->money_list($model, $p, $map);
if ($settlementType == 1) {
$time = explode(' 至 ', $time);
if (count($time) != 2) {
$data['status'] = 0;
$data['msg'] = '参数异常';
$this->ajaxReturn($data);
}
$beginTime = strtotime($time[0]);
$endTime = strtotime($time[1]) + 3600 * 24 - 1;
} else {
$beginTime = strtotime($time);
$endTime = strtotime('+1 month', $beginTime) - 1;
}
$withdrawModel = new WithdrawModel();
$data['begin_time'] = $beginTime;
$data['end_time'] = $endTime;
$data['op_id'] = is_login();
$data['op_type'] = 2;
switch ($settlementType) {
case 1:
$result = $withdrawModel->promoteWithdrawWeeklyByPromote($promote, false, $data);
break;
case 2:
$result = $withdrawModel->promoteWithdrawPerMonthByPromote($promote, false, $data);
break;
case 3:
$result = $withdrawModel->promoteWithdrawRecoupByPromote($promote, $data);
break;
}
$data = [];
$data['status'] = 0;
switch ($result) {
case -4:
case -3:
$data['msg'] = '无可补点订单';
break;
case -2:
if ($settlementType == 3) {
$data['msg'] = '无可补点订单';
} else {
$data['msg'] = '累计结算低于100元无法提现';
}
break;
case -1:
case 0:
$data['msg'] = '操作失败';
break;
case 1:
$data['status'] = 1;
$data['msg'] = '操作成功';
break;
}
$this->ajaxReturn($data);
}
public function renewReview()
{
$id = intval(I('id', 0));
$data = M('withdraw', 'tab_')->find($id);
if (empty($data) || $data['status'] != -1) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
$save['id'] = $id;
$save['status'] = 0;
$save['last_up_update_time'] = time();
$save['last_op_id'] = is_login();
$save['last_op_type'] = 2;
$res = M('withdraw', 'tab_')->save($save);
if ($res === false) {
$data['status'] = 0;
$data['msg'] = '提交失败';
} else {
$data['status'] = 1;
$data['msg'] = '提交成功';
}
$this->ajaxReturn($data);
}
public function cancelWithdraw()
{
$id = intval(I('id', 0));
$data = M('withdraw', 'tab_')->find($id);
if (empty($data) || !in_array($data['status'], [-1, 0])) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
$time = time();
$data['status'] = 1;
$data['msg'] = '撤销成功';
$withdrawSave['id'] = $id;
$withdrawSave['status'] = -2;
$withdrawSave['last_up_update_time'] = $time;
$withdrawSave['last_op_id'] = is_login();
$withdrawSave['last_op_type'] = 2;
if ($data['settlement_type'] == 3) {
$withdrawRes = M('withdraw', 'tab_')->save($withdrawSave);
if ($withdrawRes === false) {
$data['status'] = 0;
$data['msg'] = '撤销失败';
$this->ajaxReturn($data);
}
} else {
$spendMap['withdraw_id'] = $id;
$spendIds = M('Spend', 'tab_')->where($spendMap)->getField('id', true);
if (empty($spendIds)) {
$data['status'] = 0;
$data['msg'] = '数据异常';
$this->ajaxReturn($data);
}
$spendIds = implode(',', $spendIds);
$withdrawSave['spend_ids'] = $spendIds;
M('withdraw', 'tab_')->startTrans();//开启事物
$withdrawRes = M('withdraw', 'tab_')->save($withdrawSave);
if ($withdrawRes === false) {
M('withdraw', 'tab_')->rollback();//事物回滚
$data['status'] = 0;
$data['msg'] = '撤销失败';
$this->ajaxReturn($data);
}
$spendSave['selle_status'] = 0;
$spendSave['withdraw_id'] = 0;
$spendRes = M('spend', 'tab_')->where($spendMap)->save($spendSave);
if ($spendRes === false) {
M('withdraw', 'tab_')->rollback();//事物回滚
$data['status'] = 0;
$data['msg'] = '撤销失败';
} else {
M('withdraw', 'tab_')->commit();//事物提交
}
}
$this->ajaxReturn($data);
}
public function downloadProve()
{
$id = intval(I('id', 0));
if ($id) {
$withdraw = M('withdraw', 'tab_')->find($id);
if (empty($withdraw) || $withdraw['status'] != 2 || !$withdraw['transfer_proof']) {
$this->error('网络异常');
}
$file = new FileController();
$file->download($withdraw['transfer_proof']);
} else {
$this->error('参数异常');
}
}
public function cpsettlement($p = 0)
@ -655,6 +1004,8 @@ class QueryController extends ThinkController
public function withdraw()
{
$page = I('p', 1);
$map['_string'] = '1=1';
$adminid = C('USER_ADMINISTRATOR');//获取超管id
$adminmobile = M('UcenterMember')->field('mobile')->find($adminid);
$this->assign('adminmobile', $adminmobile['mobile']);
@ -664,6 +1015,12 @@ class QueryController extends ThinkController
if (isset($_REQUEST['ti_status'])) {
$map['status'] = $_REQUEST['ti_status'];
}
if (isset($_REQUEST['op_type'])) {
$map['op_type'] = $_REQUEST['op_type'];
}
if (isset($_REQUEST['settlement_type'])) {
$map['settlement_type'] = $_REQUEST['settlement_type'];
}
if (isset($_REQUEST['promote_account'])) {
if ($_REQUEST['promote_account'] == '全部') {
unset($_REQUEST['promote_account']);
@ -672,7 +1029,6 @@ class QueryController extends ThinkController
}
} else {
$map['promote_id'] = array('gt', 0);
}
$order = 'create_time desc';
@ -686,6 +1042,58 @@ class QueryController extends ThinkController
}
}
}
if (I('export', 0) == 1) {
$records = D('withdraw')->field('widthdraw_number, sum_money, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time')
->where($map)
->order($order)
->select();
if (!empty($records)) {
$data = [];
foreach ($records as $record) {
$record['op_id_text'] = $this->getOpTypeText($record['op_type'], $record['op_id']);
$record['last_op_id_text'] = $this->getOpTypeText($record['last_op_type'], $record['last_op_id']);
$record['op_type_text'] = getPromoteWithdrawOpType($record['op_type']);
$record['last_op_type_text'] = getPromoteWithdrawOpType($record['last_op_type']);
$record['settlement_type_text'] = getPromoteWithdrawSettlementType($record['settlement_type']);
$data[] = [
'widthdraw_number' => $record['widthdraw_number'],
'sum_money' => $record['sum_money'],
'promote_account' => $record['promote_account'],
'op_id_text' => $this->getOpTypeText($record['op_type'], $record['op_id']),
'last_op_id_text' => $this->getOpTypeText($record['last_op_type'], $record['last_op_id']),
'op_type_text' => getPromoteWithdrawOpType($record['op_type']),
'last_op_type_text' => getPromoteWithdrawOpType($record['last_op_type']),
'settlement_type_text' => getPromoteWithdrawSettlementType($record['settlement_type']),
'settlement_begin_time' => $record['settlement_begin_time'] ? date('Y-m-d H:i:s', $record['settlement_begin_time']) : '--',
'settlement_end_time' => date('Y-m-d H:i:s', $record['settlement_end_time']),
'create_time' => date('Y-m-d H:i:s', $record['create_time']),
'status_text' => promoteWithdrawStatus($record['status']),
'respond' => $record['respond'],
'audit_time' => $record['audit_time'] ? date('Y-m-d H:i:s', $record['audit_time']) : '--',
];
}
$field = [
'widthdraw_number' => '结算单号',
'sum_money' => '结算金额',
'promote_account' => '推广员账号',
'op_id_text' => '操作人',
'op_type_text' => '操作人类型',
'last_op_id_text' => '最后操作人',
'last_op_type_text' => '最后操作人类型',
'settlement_type_text' => '提现模式',
'settlement_begin_time' => '结算开始时间',
'settlement_end_time' => '结算截止时间',
'create_time' => '申请时间',
'status_text' => '提现状态',
'respond' => '说明',
'audit_time' => '审核时间',
];
data2csv($data,"推广结算", $field);
exit;
}
}
$model = array(
'm_name' => 'withdraw',
'order' => $order,
@ -710,8 +1118,43 @@ class QueryController extends ThinkController
//为数据权限添加
setPowerPromoteIds($map);
$this->assign('is_admin', is_administrator());
$user->money_list($model, $p, $map);
$user->money_list($model, $page, $map);
}
public function getWithdraw()
{
$promoteId = intval(I('post.promote_id', 0));
$beginTime = I('post.begin_time', '');
$endTime = I('post.end_time', '');
$msg = '';
if (empty($promoteId) || empty($beginTime) || empty($endTime)) {
$this->ajaxReturn(['msg' => $msg]);
}
$beginTime = strtotime($beginTime);
$endTime = strtotime($endTime) + 3600 * 24 - 1;
$map['promote_id'] = $promoteId;
$map['settlement_end_time'] = ['between', [$beginTime, $endTime]];
$map['status'] = ['neq', -2];
$withdraws = D('withdraw')->field('id, settlement_begin_time, settlement_end_time')
->where($map)
->select();
if (!empty($withdraws)) {
foreach ($withdraws as $withdraw) {
$settlementEndTime = date('Y-m-d', $withdraw['settlement_end_time'] + 1);
if ($withdraw['settlement_begin_time'] > 0) {
$settlementBeginTime = date('Y-m-d', $withdraw['settlement_begin_time']);
$msg .= "{$settlementBeginTime}至{$settlementEndTime}之间的订单已经提现;";
} else {
$msg .= "{$settlementEndTime}之前的订单已经提现;";
}
$msg .= '<br>';
}
}
$this->ajaxReturn(['msg' => $msg]);
}
public function set_withdraw_status()
@ -901,36 +1344,28 @@ class QueryController extends ThinkController
public function withdrawDetails($id)
{
$page = intval(I('p', 1));
$row = intval(I('row', 10));
$id = intval($id);
$map['withdraw_id'] = $id;
$model = M('Spend', 'tab_');
$data = $model
->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count('id');
//提现状态
$withdrawStatus = M('withdraw', 'tab_')
->where(array('id' => $id))
->getField('status');
$withdrawStatus = \Home\Controller\FinanceController::$withdrawStatus[$withdrawStatus];
foreach ($data as &$list) {
$list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2);
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
$withdrawId = intval($id);
$withdraw = D('withdraw')->find($withdrawId);
$records = [];
if (!empty($withdraw) && !empty($withdraw['game_ratio'])) {
$gameRatios = json_decode($withdraw['game_ratio'], true);
foreach ($gameRatios as $gameId => $gameRatio) {
$gameName = D('game')->where(array('id' => $gameId))->getField('game_name');
foreach ($gameRatio as $list) {
$records[] = [
'settlement_time' => "{$list['begin_time']} - {$list['end_time']}",
'game_name' => $gameName ?? '未知',
'sum_amount' => $list['sum_amount'],
'default_ratio' => $list['default_ratio'] ? $list['default_ratio'] . '%' : '未知',
'ratio' => $list['selle_ratio'] . '%',
'settlement_amount' => bcdiv(bcmul($list['sum_amount'], $list['selle_ratio'], 2), 100, 2),
];
}
}
}
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('withdrawStatus', $withdrawStatus);
$this->assign('settlementType', $withdraw['settlement_type']);
$this->assign('records', $records);
$this->display();
}
@ -1001,7 +1436,6 @@ class QueryController extends ThinkController
}
}
public function marketList($p=1) {
$page = intval($p);
@ -1175,4 +1609,53 @@ class QueryController extends ThinkController
}
public function getPromoteSettlementType()
{
$promoteId = intval(I('post.promote_id', 0));
$settlementType = [];
if ($promoteId > 0) {
$promote = D('promote')->field('level, settlement_type')->where(array('id' => $promoteId))->find();
if (empty($promote) || $promote['level'] != 1 || empty($promote['settlement_type'])) {
$settlementType = [];
} else {
$settlementType = WithdrawModel::$settlementTypeList;
unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_OTHER]);
if ($promote['settlement_type'] == 1) {
unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_MONTH]);
} else {
unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_WEEK]);
unset($settlementType[WithdrawModel::SETTLEMENT_TYPE_RECOUP]);
}
}
}
$this->ajaxReturn(['settlement_type' => $settlementType]);
}
public function getAmountBySettlementType()
{
$withdrawModel = new WithdrawModel();
$promoteId = intval(I('promote_id', 0));
$settlementType = intval(I('settlement_type', 0));
$time = I('time', '');
if (empty($promoteId) || !in_array($settlementType, [2, 3])) {
$this->ajaxReturn(['balance' => 0]);
}
$promote = M('promote', 'tab_')->find($promoteId);
if (empty($promote) || $promote['level'] != 1 || $promote['ver_status'] != 1 || empty($time)) {
$this->ajaxReturn(['balance' => 0]);
}
$data['begin_time'] = strtotime($time);
$data['end_time'] = strtotime('+1 month', $data['begin_time']) - 1;
if ($settlementType == 2) {
$balance = $withdrawModel->getMonthAmount($promote, $data);
} else {
$balance = $withdrawModel->getRecoupAmount($promote, $data);
}
$this->ajaxReturn(['balance' => $balance]);
}
}

@ -6,6 +6,23 @@ use Think\Model;
class PromoteGameRatioModel extends Model
{
protected $db = 'promote_game_ratio';
// 数据表前缀
protected $tablePrefix = 'tab_';
public function addLog($id)
{
$logSave = $this->find($id);
if (!empty($logSave)) {
if (empty($logSave['last_ratio_status'])) {
$logSave['last_ratio'] = D('game')->where(array('id' => $logSave['game_id']))->getField('ratio');
$logSave['last_ratio'] = $logSave['last_ratio'] ?? 0;
}
$logSave['create_time'] = $logSave['update_time'];
unset($logSave['id']);
unset($logSave['update_time']);
M('promote_game_ratio_log', 'tab_')->add($logSave);
}
}
}

@ -15,6 +15,17 @@ use Think\Model;
*/
class WithdrawModel extends Model{
//操作人类型
const OP_TYPE_PROMOTE = 1;
const OP_TYPE_ADMIN = 2;
const OP_TYPE_AUTO = 3;
//结算类型
const SETTLEMENT_TYPE_WEEK = 1;
const SETTLEMENT_TYPE_MONTH = 2;
const SETTLEMENT_TYPE_RECOUP = 3;
const SETTLEMENT_TYPE_OTHER = 9;
/**
* 构造函数
* @param string $name 模型名称
@ -28,8 +39,18 @@ class WithdrawModel extends Model{
parent::__construct($name, $tablePrefix, $connection);
}
public static $opTypeList = [
self::OP_TYPE_PROMOTE => '推广员',
self::OP_TYPE_ADMIN => '管理员',
self::OP_TYPE_AUTO => '自动',
];
public static $settlementTypeList = [
self::SETTLEMENT_TYPE_WEEK => '周结',
self::SETTLEMENT_TYPE_MONTH => '月结',
self::SETTLEMENT_TYPE_RECOUP => '补点',
self::SETTLEMENT_TYPE_OTHER => '其他',
];
/*
* 开发者提现未处理列表
@ -102,4 +123,495 @@ class WithdrawModel extends Model{
}
//生成提现单号 $type 1-周结 2-月结 3-补点
public function produceWithdrawNumber($type = 1)
{
$prefix = 'WD_';
$number = '';
switch ($type) {
case 1:
$prefix = "{$prefix}W_";
break;
case 2:
$prefix = "{$prefix}M_";
break;
case 3:
$prefix = "{$prefix}R_";
break;
}
while (true) {
$randomNum = rand(10, 99);
$number = $prefix . time() . $randomNum;
$map['widthdraw_number'] = $number;
$res = $this->where($map)->getField('id');
if (!$res) {
break;
}
}
return $number;
}
//周结
public function promoteWithdrawWeeklyByPromote($promote, $initial = false, $data = [])
{
$promoteIds = $this->getPromoteChildren($promote);
$settlementType = $promote['settlement_type'];
$settlementBeginTime = $data['begin_time'] ?? strtotime(date('Y-m-d', strtotime('-7 day', time())));
$settlementEndTime = $data['end_time'] ?? strtotime(date('Y-m-d')) - 1;
if ($initial) {
$settlementType = 9;
$settlementBeginTime = 0;
}
$spendMap['pay_status'] = 1;
$spendMap['selle_status'] = 0;
$spendMap['promote_id'] = ['in', $promoteIds];
$spendMap['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
$spendModel = M('spend', 'tab_');
$balance = $spendModel->field("sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as balance")
->where($spendMap)
->find()['balance'];
$balance = $balance ?? 0;
$balance = bcdiv($balance, 100, 2);
if ($balance < 100) {
return -2;//余额不足
}
if ($initial === false) {
$beginTime = date('Y-m-d', $settlementBeginTime);
} else {
$beginTime = '初始';
}
$endTime = date('Y-m-d', $settlementEndTime);
$gameRatios = $this->getGameRatio($spendMap, $beginTime, $endTime);
$gameRatios = $gameRatios ? json_encode($gameRatios) : '';
$thisTime = time();
$add['sum_money'] = $balance;
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(1);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
$add['spend_ids'] = '';
$add['op_id'] = $data['op_id'] ?? 0;
$add['op_type'] = $data['op_type'] ?? 3;
$add['last_op_id'] = $add['op_id'];
$add['last_op_type'] = $add['op_type'];
$add['settlement_type'] = $settlementType;
$add['game_ratio'] = $gameRatios;
M()->startTrans();//开启事物
$withdrawId = D('withdraw')->add($add);
if (!$withdrawId) {
M()->rollback();//事物回滚
return 0;//提现失败
}
$save['selle_status'] = 1;
$save['selle_time'] = $thisTime;
$save['withdraw_id'] = $withdrawId;
$res = $spendModel->where($spendMap)->save($save);
if ($res === false) {
D('withdraw')->delete($withdrawId);
M()->rollback();//事物回滚
return -1;
}
M()->commit();//事物提交
return 1;
}
//月结
public function promoteWithdrawPerMonthByPromote($promote, $initial = false, $data = [])
{
$promoteIds = $this->getPromoteChildren($promote);
$settlementType = $promote['settlement_type'];
$settlementBeginTime = $data['begin_time'] ?? strtotime(date('Y-m', strtotime('-1 month', time())));
$settlementEndTime = $data['end_time'] ?? strtotime(date('Y-m')) - 1;
if ($initial) {
$settlementType = 9;
$settlementBeginTime = 0;
$beginTime = '初始';
} else {
$beginTime = date('Y-m-d', $settlementBeginTime);
}
$endTime = date('Y-m-d', $settlementEndTime);
$spendMap['pay_status'] = 1;
$spendMap['selle_status'] = 0;
$spendMap['promote_id'] = ['in', $promoteIds];
$spendMap['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
$spendWhere = $spendMap;
$spendModel = M('spend', 'tab_');
$promoteGameRatioMap['status'] = 1;
$promoteGameRatioMap['promote_id'] = $promote['id'];
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
->where($promoteGameRatioMap)
->order('update_time desc')
->select();
$gameRatios = $this->getGameRatio($spendMap, $beginTime, $endTime);
if (empty($promoteGameRatios) || $initial) {
$balance = $spendModel->field("sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as balance")
->where($spendMap)
->find()['balance'];
$balance = $balance ?? 0;
} else {
$balance = 0;
$notInGameIds = [-1];
foreach ($promoteGameRatios as $promoteGameRatio) {
$spendWhere['game_id'] = $promoteGameRatio['game_id'];
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
$notInGameIds[] = $promoteGameRatio['game_id'];
$ratio = $promoteGameRatio['ratio'];
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
->where($spendWhere)
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
$thisBalance = $spendModel->field("sum(pay_amount * {$ratio}) as balance")
->where($spendWhere)
->find()['balance'];
$thisBalance = $thisBalance ?? 0;
$balance = bcadd($balance, $thisBalance, 2);
$gameRatios[$promoteGameRatio['game_id']] = [];
$gameRatios[$promoteGameRatio['game_id']][] = [
'selle_ratio' => $ratio,
'default_ratio' => $promoteGameRatio['ratio'],
'sum_amount' => $sumAmount,
'begin_time' => $beginTime,
'end_time' => $endTime,
];
}
}
$spendWhere['game_id'] = ['not in', $notInGameIds];
$otherBalance = $spendModel->field("sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as balance")
->where($spendWhere)
->find()['balance'];
$otherBalance = $otherBalance ?? 0;
$balance = bcadd($balance, $otherBalance, 2);
}
$balance = bcdiv($balance, 100, 2);
if ($balance < 100) {
return -2;//余额不足
}
$gameRatios = $gameRatios ? json_encode($gameRatios) : '';
$thisTime = time();
$add['sum_money'] = $balance;
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(2);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
$add['spend_ids'] = '';
$add['op_id'] = $data['op_id'] ?? 0;
$add['op_type'] = $data['op_type'] ?? 3;
$add['last_op_id'] = $add['op_id'];
$add['last_op_type'] = $add['op_type'];
$add['settlement_type'] = $settlementType;
$add['game_ratio'] = $gameRatios;
M()->startTrans();//开启事物
$withdrawId = D('withdraw')->add($add);
if (!$withdrawId) {
M()->rollback();//事物回滚
return 0;//提现失败
}
$save['selle_status'] = 1;
$save['selle_time'] = $thisTime;
$save['withdraw_id'] = $withdrawId;
$res = $spendModel->where($spendMap)->save($save);
if ($res === false) {
D('withdraw')->delete($withdrawId);
M()->rollback();//事物回滚
return -1;
}
M()->commit();//事物提交
return 1;
}
//补点
public function promoteWithdrawRecoupByPromote($promote, $data = [])
{
$promoteGameRatioMap['status'] = 1;
$promoteGameRatioMap['promote_id'] = $promote['id'];
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
->where($promoteGameRatioMap)
->order('update_time desc')
->select();
if (empty($promoteGameRatios)) {
return -3;
}
$promoteIds = $this->getPromoteChildren($promote);
$settlementType = 3;
$settlementBeginTime = $data['begin_time'] ?? strtotime(date('Y-m', strtotime('-1 month', time())));
$settlementEndTime = $data['end_time'] ?? strtotime(date('Y-m')) - 1;
$withdrawMap['promote_id'] = $promote['id'];
$withdrawMap['status'] = ['neq', -2];
$withdrawMap['settlement_begin_time'] = $settlementBeginTime;
$withdrawMap['settlement_end_time'] = $settlementEndTime;
$withdraw = D('withdraw')->where($withdrawMap)->find();
if (!empty($withdraw)) {
return -4;
}
$spendMap['pay_status'] = 1;
$spendMap['promote_id'] = ['in', $promoteIds];
$spendMap['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
$spendModel = M('spend', 'tab_');
$balance = 0;
$gameRatios = [];
foreach ($promoteGameRatios as $promoteGameRatio) {
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
$spendMap['game_id'] = $promoteGameRatio['game_id'];
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
->where($spendMap)
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
$ratio = 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
if ($ratio > 0) {
$ratio = bcsub($ratio, $promoteGameRatio['ratio'], 2);
$thisBalance = bcdiv(bcmul($sumAmount, $ratio, 2), 100, 2);
$balance = bcadd($balance, $thisBalance, 2);
$gameRatios[$promoteGameRatio['game_id']][] = [
'selle_ratio' => $ratio,
'default_ratio' => $promoteGameRatio['ratio'],
'sum_amount' => $sumAmount,
'begin_time' => date('Y-m-d', $settlementBeginTime),
'end_time' => date('Y-m-d', $settlementEndTime),
];
}
}
}
if ($balance == 0) {
return -2;//无余额
}
$gameRatios = $gameRatios ? json_encode($gameRatios) : '';
$thisTime = time();
$add['sum_money'] = $balance;
$add['promote_id'] = $promote['id'];
$add['promote_account'] = $promote['account'];
$add['create_time'] = $thisTime;
$add['status'] = 0;
$add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(3);
$add['settlement_begin_time'] = $settlementBeginTime;
$add['settlement_end_time'] = $settlementEndTime;
$add['spend_ids'] = '';
$add['op_id'] = $data['op_id'] ?? 0;
$add['op_type'] = $data['op_type'] ?? 3;
$add['last_op_id'] = $add['op_id'];
$add['last_op_type'] = $add['op_type'];
$add['settlement_type'] = $settlementType;
$add['game_ratio'] = $gameRatios;
$withdrawId = D('withdraw')->add($add);
if (!$withdrawId) {
return 0;//补点失败
}
return 1;
}
public function getRecoupAmount($promote, $data = [])
{
$promoteGameRatioMap['status'] = 1;
$promoteGameRatioMap['promote_id'] = $promote['id'];
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
->where($promoteGameRatioMap)
->order('update_time desc')
->select();
if (empty($promoteGameRatios)) {
return 0;
}
$promoteIds = $this->getPromoteChildren($promote);
$settlementBeginTime = $data['begin_time'] ?? strtotime(date('Y-m', strtotime('-1 month', time())));
$settlementEndTime = $data['end_time'] ?? strtotime(date('Y-m')) - 1;
$spendMap['pay_status'] = 1;
$spendMap['promote_id'] = ['in', $promoteIds];
$spendMap['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
$spendModel = M('spend', 'tab_');
$balance = 0;
foreach ($promoteGameRatios as $promoteGameRatio) {
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
$spendMap['game_id'] = $promoteGameRatio['game_id'];
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
->where($spendMap)
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
$ratio = 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
if ($ratio > 0) {
$ratio = bcsub($ratio, $promoteGameRatio['ratio'], 2);
$thisBalance = bcdiv(bcmul($sumAmount, $ratio, 2), 100, 2);
$balance = bcadd($balance, $thisBalance, 2);
}
}
}
return $balance;
}
public function getMonthAmount($promote, $data = [])
{
$promoteIds = $this->getPromoteChildren($promote);
$settlementBeginTime = $data['begin_time'] ?? strtotime(date('Y-m', strtotime('-1 month', time())));
$settlementEndTime = $data['end_time'] ?? strtotime(date('Y-m')) - 1;
$spendMap['pay_status'] = 1;
$spendMap['selle_status'] = 0;
$spendMap['promote_id'] = ['in', $promoteIds];
$spendMap['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
$spendWhere = $spendMap;
$spendModel = M('spend', 'tab_');
$promoteGameRatioMap['status'] = 1;
$promoteGameRatioMap['promote_id'] = $promote['id'];
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
->where($promoteGameRatioMap)
->order('update_time desc')
->select();
if (empty($promoteGameRatios)) {
$balance = $spendModel->field("sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as balance")
->where($spendMap)
->find()['balance'];
$balance = $balance ?? 0;
} else {
$balance = 0;
$notInGameIds = [-1];
foreach ($promoteGameRatios as $promoteGameRatio) {
$spendWhere['game_id'] = $promoteGameRatio['game_id'];
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
$notInGameIds[] = $promoteGameRatio['game_id'];
$ratio = $promoteGameRatio['ratio'];
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
->where($spendWhere)
->find()['sum_amount'];
$sumAmount = $sumAmount ?? 0;
foreach ($turnoverRatios as $turnoverRatio) {
if ($sumAmount >= $turnoverRatio['turnover']) {
$ratio = $turnoverRatio['ratio'];
break;
}
}
$thisBalance = $spendModel->field("sum(pay_amount * {$ratio}) as balance")
->where($spendWhere)
->find()['balance'];
$thisBalance = $thisBalance ?? 0;
$balance = bcadd($balance, $thisBalance, 2);
}
}
$spendWhere['game_id'] = ['not in', $notInGameIds];
$otherBalance = $spendModel->field("sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as balance")
->where($spendWhere)
->find()['balance'];
$otherBalance = $otherBalance ?? 0;
$balance = bcadd($balance, $otherBalance, 2);
}
$balance = bcdiv($balance, 100, 2);
return $balance;
}
private function getSpendMessageByGame($map)
{
$field = 'game_id, selle_ratio, sum(pay_amount) as sum_amount, pay_time';
$spendModel = M('spend', 'tab_');
$gameSpendRatios = $spendModel->field($field)
->where($map)
->group('game_id, selle_ratio')
->order('game_id asc, pay_time asc')
->select();
return $gameSpendRatios;
}
private function getPromoteChildren($promote) {
$promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"];
$promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
$promoteIds[] = $promote['id'];
return $promoteIds;
}
private function getGameRatio($map, $beginTime, $endTime)
{
$gameRatios = [];
$gameSpendRatios = $this->getSpendMessageByGame($map);
foreach ($gameSpendRatios as $gameSpendRatio) {
$gameRatios[$gameSpendRatio['game_id']][] = [
'selle_ratio' => $gameSpendRatio['selle_ratio'],
'sum_amount' => $gameSpendRatio['sum_amount'],
'begin_time' => date('Y-m-d', $gameSpendRatio['pay_time']),
'end_time' => date('Y-m-d', $gameSpendRatio['pay_time']),
];
}
foreach ($gameRatios as $key => $gameRatio) {
$gameRatios[$key][0]['begin_time'] = $beginTime;
$gameRatios[$key][count($gameRatio) - 1]['end_time'] = $endTime;
if (count($gameRatio) > 1) {
foreach ($gameRatios[$key] as $childKey => $childList) {
$gameRatios[$key][$childKey]['end_time'] = isset($gameRatios[$key][$childKey + 1]) ? $gameRatios[$key][$childKey + 1]['begin_time'] : $gameRatios[$key][$childKey]['end_time'];
}
}
}
return $gameRatios;
}
}

@ -302,6 +302,22 @@
<span class="notice-text">显示推广员的平台币余额,推广员平台币用于会长代充或者转移给下级推广员</span>
</td>
</tr>
<if condition="$data['level'] eq 1">
<tr>
<td class="l">结算模式:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" value="1" name="settlement_type" <eq name="data['settlement_type']" value="1">checked="checked"</eq>>周结
</label>
<label>
<input type="radio" value="2" name="settlement_type" <eq name="data['settlement_type']" value="2">checked="checked"</eq>>月结
</label>
</span>
<span class="notice-text">会长推广结算模式</span>
</td>
</tr>
</if>
</tbody>
</table>
</div>

@ -3,6 +3,7 @@
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link href="__STATIC__/icons_alibaba/iconfont.css" rel="stylesheet">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
@ -22,6 +23,48 @@
.tabcon1711 .mustmark {
margin-left:-7px;
}
.list-ratio {
display: table;
}
.list-ratio .li-ratio {
display: flex;
margin-bottom: 20px;
align-items: center;
}
.list-ratio .li-ratio .turnover, .list-ratio .li-ratio .turnover-ratio {
position: relative;
}
.list-ratio .li-ratio .turnover span, .list-ratio .li-ratio .turnover-ratio .error-message {
color: red;
position: absolute;
left: 0;
top: 30px;
white-space: nowrap;
display: none;
}
.iconfont-btn {
cursor: pointer;
}
.iconfont-style {
font-size: 18px;
color: #fff;
border-radius: 4px;
border: 0;
padding: 5px;
margin-left: 10px;
}
.iconfont-selected {
background-color: #0A9AF2;
}
.iconfont-selected:hover {
background-color: #03a9f4;
}
.iconfont-unselected {
background-color: #999;
}
.iconfont-unselected:hover {
background-color: #ababab;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
@ -83,11 +126,62 @@
<tr>
<td class="l">现分成比例:</td>
<td class="r table_radio">
<input type="text" class="txt" name="ratio" id="ratio" value="{$record.ratio|default='0.00'}" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')">
<label>默认分成比例:</label>
<input type="text" class="txt ratio" name="ratio" id="ratio" value="{$record.ratio|default='0.00'}" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 60px;">
<span class="form_unit">%</span>
<span class="notice-text">当前需要修改成的分成比例</span>
</td>
</tr>
<tr><td style="height: 10px;"></td></tr>
<tr>
<td class="l"></td>
<td class="r table_radio">
<div class="list-ratio">
<empty name="record['turnover_ratio']">
<div class="li-ratio">
<label>月流水大于等于:</label>
<div class="turnover">
<input type="text" class="txt" name="turnover[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 100px;margin-right: 10px;">
<span></span>
</div>
<label>分成比例:</label>
<div class="turnover-ratio">
<input type="text" class="txt" name="turnover_ratio[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 60px;">
<span class="form_unit" style="margin-right: 10px;">%</span>
<span class="error-message">sadasdas</span>
</div>
<span class="iconfont-btn iconfont-btn-add" title="添加流水比例"><i class="iconfont-style iconfont-selected iconfont iconjiahao1"></i></span>
<span class="iconfont-btn iconfont-btn-del" title="删除流水比例"><i class="iconfont-style iconfont-unselected iconfont iconjianhao"></i></span>
</div>
<else/>
<volist name="record['turnover_ratio']" key="key" id="vo">
<div class="li-ratio">
<label>月流水大于等于:</label>
<div class="turnover">
<input type="text" class="txt" name="turnover[]" value="{$vo['turnover']|default=''}" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 100px;margin-right: 10px;">
<span></span>
</div>
<label>分成比例:</label>
<div class="turnover-ratio">
<input type="text" class="txt" name="turnover_ratio[]" value="{$vo['ratio']|default=''}" placeholder="" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width: 60px;">
<span class="form_unit" style="margin-right: 10px;">%</span>
<span class="error-message"></span>
</div>
<if condition="$key eq 1">
<span class="iconfont-btn iconfont-btn-add" title="添加流水比例"><i class="iconfont-style iconfont-selected iconfont iconjiahao1"></i></span>
<if condition="1 eq count($record['turnover_ratio'])">
<span class="iconfont-btn iconfont-btn-del" title="删除流水比例"><i class="iconfont-style iconfont-unselected iconfont iconjianhao"></i></span>
<else/>
<span class="iconfont-btn iconfont-btn-del" title="删除流水比例"><i class="iconfont-style iconfont-selected iconfont iconjianhao"></i></span>
</if>
</if>
</div>
</volist>
</empty>
</div>
<span class="notice-text" style="width: auto;"></span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>开始时间:</td>
<td class="r table_radio">
@ -147,13 +241,15 @@ $(".select_gallery").select2();
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd',
format: 'yyyy-mm',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
startView: 'year',
minView:'year',
maxView:'year',
});
showTab();
@ -239,6 +335,119 @@ $(function(){
}
});
});
$('.iconfont-btn-add').click(function (e) {
var delBtn = $('.iconfont-btn-del');
var html = '';
html += '<div class="li-ratio">';
html += '<label>月流水大于等于:</label>';
html += '<div class="turnover">';
html += '<input type="text" class="txt" name="turnover[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style="width: 100px;margin-right: 10px;">';
html += '<span></span>';
html += '</div>';
html += '<label>分成比例:</label>';
html += '<div class="turnover-ratio">';
html += '<input type="text" class="txt" name="turnover_ratio[]" value="" placeholder="" onKeyUp="value=value.replace(/[^\\w\\.\\/]/ig, \'\')" style="width: 60px;">';
html += '<span class="form_unit" style="margin-right: 10px;">%</span>';
html += '<span class="error-message"></span>';
html += '</div>';
html += '</div>';
$('.list-ratio').append(html);
if ($('.list-ratio').children().length > 1 && delBtn.children('i').hasClass('iconfont-unselected')) {
delBtn.children('i').removeClass('iconfont-unselected');
delBtn.children('i').addClass('iconfont-selected');
}
$('.list-ratio').children(':last-child').children('.turnover').children('input').change(function (e) {
turnoverChangeHandle();
});
$('.list-ratio').children(':last-child').children('.turnover-ratio').children('input').change(function (e) {
turnoverRatioChangeHandle();
});
});
$('.list-ratio').children('.li-ratio').children('.turnover').children('input').change(function (e) {
turnoverChangeHandle();
});
$('.list-ratio').children('.li-ratio').children('.turnover-ratio').children('input').change(function (e) {
turnoverRatioChangeHandle();
});
function turnoverChangeHandle()
{
$('.list-ratio').children('.li-ratio').children('.turnover').children('input').each(function () {
var that = $(this);
var thatLiRatio = that.parent().parent();
var thatLiRatioIndex = thatLiRatio.index();
var prevTurnover = 0;
var prev = thatLiRatio.prev().children().children('input');
var thatTurnover = parseFloat(that.val());
if (thatLiRatioIndex > 0) {
prevTurnover = parseFloat(prev.val());
prevTurnoverHandle(thatTurnover, prevTurnover, that);
}
});
}
function turnoverRatioChangeHandle() {
var ratio = parseFloat($('#ratio').val());
$('.list-ratio').children('.li-ratio').children('.turnover-ratio').children('input').each(function () {
var that = $(this);
var thatLiRatio = that.parent().parent();
var thatLiRatioIndex = thatLiRatio.index();
var thatTurnoverRatio = parseFloat(that.val());
if (thatLiRatioIndex === 0) {
console.log(111)
prevTurnoverRatio = ratio;
prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, true);
} else {
var prev = thatLiRatio.prev().children('.turnover-ratio').children('input');
var prevTurnoverRatio = parseFloat(prev.val());
prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that);
}
});
}
function prevTurnoverHandle(thatTurnover, prevTurnover, that)
{
if (thatTurnover <= prevTurnover) {
that.parent().children('span').text('月流水必须大于上一个月流水');
that.parent().children('span').show();
} else {
that.parent().children('span').hide();
}
return true;
}
function prevTurnoverRatioHandle(thatTurnoverRatio, prevTurnoverRatio, that, isDefault = false)
{
if (thatTurnoverRatio <= prevTurnoverRatio) {
var msg = isDefault ? '月流水分成比例必须大于默认分成比例' : '月流水分成比例必须大于上一个月流水分成比例';
that.parent().children('.error-message').text(msg);
that.parent().children('.error-message').show();
} else {
that.parent().children('.error-message').hide();
}
return true;
}
$('.iconfont-btn-del').click(function (e) {
var that = $(this);
if ($('.list-ratio').children().length > 1) {
$('.list-ratio').children(':last-child').remove();
if ($('.list-ratio').children().length === 1) {
that.children('i').removeClass('iconfont-selected');
that.children('i').addClass('iconfont-unselected');
}
}
});
});
</script>
</block>

@ -43,24 +43,30 @@
margin-left:-7px
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:此功能可设置所有公会对应的游戏分成比例。</p>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<empty name="show_status">
<a class=" " href="{:U('applyRatio?model='.$model['id'])}"><span class="button_icon button_icon1"></span>游戏分成比例申请</a>
<if condition = "$reviewRule">
<a class="ajax-post " target-form="ids" url="{:U('setStatus',array('status'=>1))}"><span class="button_icon button_icon9"></span>审核通过</a>
<a href="javascript:;" onclick="refuse()" style="color: red;"><span class="button_icon button_icon9"></span>审核拒绝</a>
</if>
</empty>
<div class="cf main-place top_nav_list navtab_list">
<div class="fr">
<a <if condition="$group eq 1"> class="tabchose" </if> href="{:U('lists?group=1')}">分成比例申请</a>
<a <if condition="$group eq 2"> class="tabchose" </if> href="{:U('lists?group=2')}">申请记录</a>
</div>
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:此功能可设置所有公会对应的游戏分成比例。</p>
</div>
<if condition="$group eq 1">
<div class="fl button_list">
<div class="tools">
<empty name="show_status">
<a class=" " href="{:U('applyRatio?model='.$model['id'])}"><span class="button_icon button_icon1"></span>游戏分成比例申请</a>
<if condition = "$reviewRule">
<a class="ajax-post " target-form="ids" url="{:U('setStatus',array('status'=>1))}"><span class="button_icon button_icon9"></span>审核通过</a>
<a href="javascript:;" onclick="refuse()" style="color: red;"><span class="button_icon button_icon9"></span>审核拒绝</a>
</if>
</empty>
</div>
</div>
</if>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
@ -91,7 +97,7 @@
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteGameRatio/lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteGameRatio/lists','model='.$model['name'] .'&row='.I('row') . '&group=' . $group,false)}">搜索</a>
</div>
</div>
</div>
@ -119,7 +125,9 @@
<th>分成比例审核</th>
<th>申请人</th>
<th>确认人</th>
<th>操作</th>
<if condition="$group eq 1">
<th>操作</th>
</if>
</tr>
</thead>
@ -153,9 +161,11 @@
<td>{$record.status_text}</td>
<td>{$record.applicant}</td>
<td>{$record.reviewer}</td>
<td>
<a href="{:U('applyRatio', array('id'=>$record['id']))}" class="">修改</a>
</td>
<if condition="$group eq 1">
<td>
<a href="{:U('applyRatio', array('id'=>$record['id']))}" class="">修改</a>
</td>
</if>
</tr>
</volist>
</if>
@ -164,6 +174,15 @@
</div>
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
@ -334,5 +353,10 @@ function refuse() {
$(".jsgamecheckall").click(function(){
$(this).closest('.jsgamecheckallbox').siblings("#game_list").find(".jsgameid").prop("checked", this.checked);
});
$(".export-btn").on("click",function(e){
e.preventDefault();
window.location.href=$(this).attr("href")
})
</script>
</block>

File diff suppressed because it is too large Load Diff

@ -78,13 +78,29 @@
<input type="text" name="widthdraw_number" class="" value="{:I('widthdraw_number')}" placeholder="提现单号">
</div>
<div class="input-list">
<select name="ti_status">
<select name="ti_status" class="select_gallery">
<option value="">提现状态</option>
<?php foreach (promoteWithdrawStatus() as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<select name="op_type" class="select_gallery">
<option value="">操作人类型</option>
<?php foreach (getPromoteWithdrawOpType() as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<div class="input-list">
<select name="settlement_type" class="select_gallery">
<option value="">提现模式</option>
<?php foreach (getPromoteWithdrawSettlementType() as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('Query/withdraw','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
@ -106,9 +122,16 @@
<input class="check-all" type="checkbox">
</th>
<th>提现单号</th>
<th ><a class="paixu" data-order='sum_money'>提现金额</a></th>
<th><a class="paixu" data-order='sum_money'>提现金额</a></th>
<th>推广员账号</th>
<th ><a class="paixu" data-order='create_time'>申请时间</a></th>
<th>操作人</th>
<th>操作人类型</th>
<th>最后操作人</th>
<th>最后操作人类型</th>
<th>提现模式</th>
<th>结算开始时间</th>
<th>结算截止时间</th>
<th><a class="paixu" data-order='create_time'>申请时间</a></th>
<th>提现状态</th>
<th>说明</th>
<th>审核时间</th>
@ -142,8 +165,31 @@
{:encryptStr(get_promote_name($data['promote_id']))}
</if>
</td>
<td>
<if condition="$data.op_type eq 1">
{:get_promote_name($data['op_id'])}
<elseif condition="$data.op_type eq 2"/>
{:getAdminNickname($data['op_id'])}
<else/>
自动
</if>
</td>
<td>{:getPromoteWithdrawOpType($data['op_type'])}</td>
<td>
<if condition="$data.last_op_type eq 1">
{:get_promote_name($data['last_op_id'])}
<elseif condition="$data.last_op_type eq 2"/>
{:getAdminNickname($data['last_op_id'])}
<else/>
自动
</if>
</td>
<td>{:getPromoteWithdrawOpType($data['last_op_type'])}</td>
<td>{:getPromoteWithdrawSettlementType($data['settlement_type'])}</td>
<td><notempty name="data.settlement_begin_time">{$data.settlement_begin_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td><notempty name="data.settlement_end_time">{$data.settlement_end_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td><notempty name="data.create_time">{$data.create_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td>{:promoteWithdrawStatus($data['status'])}</td>
<td><span <if condition="$data['status'] == -2">style="color: #999;"</if>>{:promoteWithdrawStatus($data['status'])}</span></td>
<td>{$data.respond}</td>
<td><notempty name="data.audit_time">{$data.audit_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>
<td>
@ -161,7 +207,7 @@
</empty>
<tr class="data_summary">
<td>汇总</td>
<td colspan="11">当页提现:{:null_to_0(array_sum(array_column(arrayPromoteWithdrawStatus('status','',$list_data),'sum_money')))}元 今日提现:{:null_to_0(floor($ttotal*100)/100)}元 昨日提现:{:null_to_0(floor($ytotal*100)/100)}元 累计提现:{:null_to_0(floor($total*100)/100)}元</td>
<td colspan="99">累计提现:{:null_to_0(floor($total*100)/100)}元</td>
</tr>
</tbody>
</table>
@ -169,7 +215,8 @@
</div>
<div class="page">
<if condition="$is_admin eq true ">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>12,'xlsname'=>'结算管理_推广提现',),I('get.')))}">导出</a>
<a class="sch-btn export-btn"
href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
</if>
{$_page|default=''}
</div>
@ -288,6 +335,11 @@
content: '/admin.php?s=/Query/withdrawDetails/id/'+id+'' //iframe的url
});
}
$(".export-btn").on("click",function(e){
e.preventDefault();
window.location.href=$(this).attr("href")
})
</script>
<!--打款弹出层-->
<script type="text/javascript">
@ -368,6 +420,7 @@
function uploadFile() {
if (uploaderFile === false) {
iconInfo = {userId:"kazaff", md5:"",icon:1}; //用户会话信息
uploaderFile = true;
var uploader = WebUploader.create({
// 选完文件后,是否自动上传。
@ -386,8 +439,8 @@
paste: document.body,
accept: {
title: '文件',
extensions: 'png,gif,jpg,jpeg,bmp,txt,doc*,xlsx,asp,pdf',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp,.txt,.doc*,.xlsx,.asp,.pdf',
extensions: 'png,gif,jpg,jpeg,bmp,txt,doc*,xls*,asp',
mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp,.txt,.doc*,.xls*,.asp',
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
@ -397,6 +450,7 @@
thumb:true,
compress:false,
prepareNextFile: true,
formData: function(){return $.extend(true, {}, iconInfo);},
chunked:false,
duplicate: true
});
@ -454,6 +508,7 @@
uploader.on( 'uploadSuccess', function( file, response ) {
var text = '已上传';
console.log(response);
if (response.status == 1) {
$('#transfer_proof').val(response.id);
} else {

@ -32,40 +32,33 @@ body{ padding: 0px; }
<!-- 表头 -->
<thead>
<tr>
<th>游戏订单号</th>
<th>游戏</th>
<th>玩家账号</th>
<th>推广员账号</th>
<th>订单总额</th>
<th>直充</th>
<th>内充</th>
<th>分成比例(直充|内充)</th>
<th>收益</th>
<th>充值时间</th>
<th>订单状态</th>
<th>结算时间</th>
<th>游戏名称</th>
<th>流水总额</th>
<if condition="$settlementType eq 3">
<th>默认分成比例</th>
<th>补点分成比例</th>
<else/>
<th>分成比例</th>
</if>
<th>结算总额</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<volist name="listData" id="vo">
<volist name="records" id="record">
<tr>
<td>{$vo.pay_order_number}</td>
<td>{$vo.game_name}</td>
<td>{$vo.user_account}</td>
<td>{$vo.promote_account}</td>
<td>{$vo.pay_amount}</td>
<if condition="$vo.pay_way eq -1">
<td>0</td>
<td>{$vo.pay_amount}</td>
<td>{$record.settlement_time}</td>
<td>{$record.game_name}</td>
<td>{$record.sum_amount}</td>
<if condition="$settlementType eq 3">
<td>{$record.default_ratio}</td>
<td>{$record.ratio}</td>
<else/>
<td>{$vo.pay_amount}</td>
<td>0</td>
<td>{$record.ratio}</td>
</if>
<td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
<td>{$vo.pay_time}</td>
<td>{$withdrawStatus}</td>
<td>{$record.settlement_amount}</td>
</tr>
</volist>
</tbody>

@ -1412,6 +1412,7 @@ if (!function_exists('dd')) {
function promoteWithdrawStatus($status = null)
{
$statusData = [
-2 => '已撤销',
-1 => '审核未通过',
0 => '待审核',
1 => '汇款中',
@ -1425,3 +1426,32 @@ function promoteWithdrawStatus($status = null)
return $statusData;
}
//获取提现操作人类型
function getPromoteWithdrawOpType($opType = null)
{
if ($opType) {
return Admin\Model\WithdrawModel::$opTypeList[$opType] ?? '未知';
} else {
return Admin\Model\WithdrawModel::$opTypeList;
}
}
//获取管理员账号
function getAdminNickname($adminId)
{
$adminId = intval($adminId);
if ($adminId) {
return M('member')->where(array('id' => $adminId))->getField('nickname');
}
return '未知';
}
//获取提现操作人类型
function getPromoteWithdrawSettlementType($type = null)
{
if ($type) {
return Admin\Model\WithdrawModel::$settlementTypeList[$type] ?? '未知';
} else {
return Admin\Model\WithdrawModel::$settlementTypeList;
}
}

@ -2,6 +2,7 @@
namespace Home\Controller;
use Admin\Model\WithdrawModel;
use Base\Model\Model;
use OT\DataDictionary;
use Base\Repository\PromoteRepository;
@ -284,6 +285,7 @@ class FinanceController extends BaseController
//提现
public function withdraw()
{
$this->error('无法执行此操作');
//是否是会长
$this->purview();
//验证安全密码
@ -339,6 +341,11 @@ class FinanceController extends BaseController
$add['widthdraw_number'] = $this->produceWithdrawNumber();
$add['settlement_end_time'] = $thisDay - 1;
$add['spend_ids'] = '';
$add['op_id'] = $this->loginPromote['id'];
$add['op_type'] = 1;
$add['last_op_id'] = $this->loginPromote['id'];
$add['last_op_type'] = 1;
$add['settlement_type'] = 4;
M()->startTrans();//开启事物
$withdrawId = M('withdraw', 'tab_')->add($add);
@ -389,6 +396,7 @@ class FinanceController extends BaseController
$begTime = strtotime(date('Y-m-d', strtotime($initBegTime)));
$endTime = strtotime(date('Y-m-d', strtotime($initEndTime))) + 3600 * 24;
$status = '';
$settlementType = intval(I('settlement_type', 0));
$parameter['p'] = $page;
$parameter['row'] = $row;
@ -413,8 +421,11 @@ class FinanceController extends BaseController
$map['status'] = $status;
}
}
if (!empty($settlementType)) {
$map['settlement_type'] = $settlementType;
}
$data = $model->field('id,widthdraw_number,create_time,settlement_end_time,sum_money,status,respond,transfer_proof')
$data = $model->field('id, widthdraw_number, create_time, settlement_begin_time, settlement_end_time, sum_money, status, respond, transfer_proof, op_id, op_type, last_op_id, last_op_type, settlement_type')
->where($map)
->order('id desc')
->page($page, $row)
@ -426,8 +437,14 @@ class FinanceController extends BaseController
if (!empty($data)) {
foreach ($data as &$list) {
$list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
$list['settlement_begin_time'] = $list['settlement_begin_time'] ? date('Y-m-d H:i:s', $list['settlement_begin_time']) : '--';
$list['settlement_end_time'] = date('Y-m-d H:i:s', $list['settlement_end_time']);
$list['status_name'] = FinanceController::$withdrawStatus[$list['status']];
$list['op_id'] = $this->getOpIdByType($list['op_id'], $list['op_type']);
$list['last_op_id'] = $this->getOpIdByType($list['last_op_id'], $list['last_op_type']);
$list['op_type'] = getPromoteWithdrawOpType($list['op_type']);
$list['last_op_type'] = getPromoteWithdrawOpType($list['last_op_type']);
$list['settlement_type_text'] = WithdrawModel::$settlementTypeList[$list['settlement_type']] ?? '未知';
switch ($list['status']) {
case -2:
$list['status_name'] = '<span style="color: #bbbaba;">' . $list['status_name'] . '</span>';
@ -443,6 +460,8 @@ class FinanceController extends BaseController
$page = set_pagination($count, $row, $parameter);
$settlementTypeList = WithdrawModel::$settlementTypeList;
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('initBegTime', $initBegTime);
@ -451,9 +470,27 @@ class FinanceController extends BaseController
$this->assign('_page', $page);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->assign('settlementTypeList', $settlementTypeList);
$this->display();
}
private function getOpIdByType($opId, $opType)
{
switch ($opType) {
case 1:
$opId = get_promote_name($opId);
break;
case 2:
$opId = getAdminNickname($opId);
break;
case 3:
$opId = '自动';
break;
}
return $opId;
}
//提现明细
public function withdrawDtl()
{
@ -584,6 +621,7 @@ class FinanceController extends BaseController
//审核拒绝 重新审核
public function renewReview()
{
$this->error('无法执行此操作');
//是否是会长
$this->purview();
//验证安全密码
@ -610,6 +648,8 @@ class FinanceController extends BaseController
$save['status'] = 0;
$save['id'] = $id;
$save['last_op_id'] = $this->loginPromote['id'];
$save['last_op_type'] = 1;
$res = M('withdraw', 'tab_')->save($save);
if ($res === false) {
$data['status'] = 0;
@ -624,6 +664,7 @@ class FinanceController extends BaseController
//撤销提现
public function cancelWithdraw()
{
$this->error('无法执行此操作');
//是否是会长
$this->purview();
//验证安全密码
@ -661,6 +702,8 @@ class FinanceController extends BaseController
$withdrawSave['status'] = -2;
$withdrawSave['spend_ids'] = $spendIds;
$withdrawSave['last_up_update_time'] = $time;
$withdrawSave['last_op_id'] = $this->loginPromote['id'];
$withdrawSave['last_op_type'] = 1;
M('withdraw', 'tab_')->startTrans();//开启事物
$withdrawRes = M('withdraw', 'tab_')->save($withdrawSave);

@ -446,7 +446,7 @@ class PromoteController extends BaseController
->where($map)
->join("left join tab_game gm on gm.id=sv.game_id")
->field('sv.*,gm.icon')
->order("sv.start_time desc")
->order("sv.start_time asc")
->page($pg, 20)
->select();

@ -1817,7 +1817,7 @@ class QueryController extends BaseController
}
}
$orderBy = 'login_time desc';
$orderBy = 'recharge_cost desc';
if (!empty($sortName)) {
if (in_array($sortName, $sortNameData)) {
$desc = ' desc';

@ -35,7 +35,7 @@
</ul>
</div>
<div style="margin-top: 2.4vh;">
<button class="withdraw" id="withdraw">提现</button>
<!-- <button class="withdraw" id="withdraw">提现</button>-->
</div>
<div class="page-list promote-index-list promote-index-list-news">
<div class="trunk-title-main"><span>{$meta_title}</span></div>

@ -143,8 +143,8 @@
<th>订单总额</th>
<th>直充</th>
<th>内充</th>
<th>分成比例(直充|内充)</th>
<th>收益</th>
<!-- <th>分成比例(直充|内充)</th>-->
<!-- <th>收益</th>-->
<th>充值时间</th>
<th>订单状态</th>
</tr>
@ -170,8 +170,8 @@
<td>{$vo.pay_amount}</td>
<td>0.00</td>
</if>
<td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
<!-- <td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>-->
<!-- <td>{$vo.income}</td>-->
<td>{$vo.pay_time}</td>
<td>{$vo.selle_status}</td>
</tr>
@ -184,8 +184,8 @@
<td>{$total.pay_amount}</td>
<td>{$total.direct_pay_amount}</td>
<td>{$total.inner_pay_amount}</td>
<td>--</td>
<td>{$total.income}</td>
<!-- <td>&#45;&#45;</td>-->
<!-- <td>{$total.income}</td>-->
<td>--</td>
<td>--</td>
</tr>

@ -97,6 +97,15 @@
value="{:I('widthdraw_number','')}">
</div>
<div class="form-group normal_space">
<select name="settlement_type" class="select_gallery">
<option value="">提现模式</option>
<?php foreach (getPromoteWithdrawSettlementType() as $key => $value) :?>
<option value="<?=$key?>"><?=$value?></option>
<?php endforeach;?>
</select>
</div>
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">交易时间:</label>
<div class="select-time">
@ -149,7 +158,13 @@
<tr class="odd">
<th>提现订单</th>
<th>提现日期</th>
<th>结算开始日期</th>
<th>结算截止日期</th>
<th>提现模式</th>
<th>操作人</th>
<th>操作人类型</th>
<th>最后操作人</th>
<th>最后操作人类型</th>
<th>收益金额</th>
<th>实际提现金额</th>
<th>提现状态</th>
@ -168,7 +183,13 @@
<tr class="num2">
<td>{$vo.widthdraw_number}</td>
<td>{$vo.create_time}</td>
<td>{$vo.settlement_begin_time}</td>
<td>{$vo.settlement_end_time}</td>
<td>{$vo.settlement_type_text}</td>
<td>{$vo.op_id}</td>
<td>{$vo.op_type}</td>
<td>{$vo.last_op_id}</td>
<td>{$vo.last_op_type}</td>
<td>{$vo.sum_money}</td>
<td>{$vo.sum_money}</td>
<td>{$vo.status_name}</td>
@ -178,11 +199,11 @@
<if condition="$vo['status'] eq 2">
<a data-href="{:U('download/Remittancecer',['id'=>$vo['id']])}" class="ajax-get">汇款证明</a>
<elseif condition="$vo['status'] eq -1"/>
<span class="renew-review" data-id="{$vo['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>
<!-- <span class="renew-review" data-id="{$vo['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>-->
</if>
<a href="{:U('settlementOrder', array('id'=>$vo['id']))}">结算单</a>
<if condition="$vo['status'] eq -1 or $vo['status'] eq 0">
<span class="cancel-withdraw" data-id="{$vo['id']}" style="color: red;cursor: pointer;">撤销提现</span>
<!-- <span class="cancel-withdraw" data-id="{$vo['id']}" style="color: red;cursor: pointer;">撤销提现</span>-->
</if>
</td>
</tr>
@ -216,6 +237,7 @@
<script type="text/javascript">
$().ready(function () {
setValue('row', '{:I("get.row",10)}');
setValue('settlement_type', '{:I("get.settlement_type",0)}');
var date = "{$setdate}";
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',

@ -991,4 +991,71 @@ CREATE TABLE `tab_cp_game_ratio` (
-- 玩家列表账户锁定添加备注 2020-01-09 郑昌隆
ALTER TABLE `tab_user` ADD COLUMN `lock_remark` varchar(512) NOT NULL DEFAULT '' COMMENT '账号锁定原因' after lock_status;
-- 2019-12-30
-- 会长管理后台提现 cxj
ALTER TABLE `tab_withdraw`
ADD COLUMN `settlement_begin_time` int(10) NOT NULL DEFAULT 0 COMMENT '结算开始时间' AFTER `old_promote_account`;
ALTER TABLE `tab_withdraw`
ADD COLUMN `op_id` int(11) NOT NULL DEFAULT 0 COMMENT '操作id';
ALTER TABLE `tab_withdraw`
ADD COLUMN `op_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '操作人1-推广员 2-管理员 3-自动';
ALTER TABLE `tab_withdraw`
ADD COLUMN `last_op_id` int(11) NOT NULL DEFAULT 0 COMMENT '最后操作人id',
ADD COLUMN `last_op_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '最后操作人1-推广员 2-管理员 3-自动';
-- 2019-12-31
-- 推广员结算类型 cxj
ALTER TABLE `tab_promote`
ADD COLUMN `settlement_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '结算类型1-周结 2-月结';
ALTER TABLE tab_promote add `company_belong` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会归属0-内团1-外团';
ALTER TABLE tab_promote add `company_relation` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会关系0-自主开发及维护1-只维护';
-- 2020-01-02
-- 提现结算类型 cxj
ALTER TABLE `tab_withdraw`
ADD COLUMN `settlement_type` tinyint(3) NOT NULL DEFAULT 3 COMMENT '结算类型1-周结 2-月结 3-管理员提现 4-推广员提现 5-其他';
-- 2020 01-03 cxj
ALTER TABLE `sys_file`
MODIFY COLUMN `mime` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '文件mime类型';
ALTER TABLE `tab_spend`
MODIFY COLUMN `selle_status` int(11) NOT NULL DEFAULT 0 COMMENT '渠道结算 0未结算1 结算',
MODIFY COLUMN `selle_ratio` double(5, 2) DEFAULT 0.00 COMMENT '渠道分成比例';
-- 2020 01-06 cxj
ALTER TABLE `tab_promote_game_ratio`
ADD COLUMN `turnover_ratio` varchar(2000) NOT NULL COMMENT '流水分成比例' AFTER `last_ratio_status`;
ALTER TABLE `tab_promote_game_ratio`
ADD COLUMN `last_turnover_ratio` varchar(2000) NOT NULL COMMENT '上次流水分成比例' AFTER `turnover_ratio`;
-- 2020 01-07 cxj
ALTER TABLE `tab_withdraw`
ADD COLUMN `game_ratio` varchar(5000) NOT NULL COMMENT '游戏提现实际分成比例';
ALTER TABLE `tab_withdraw`
MODIFY COLUMN `settlement_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '结算类型1-周结 2-月结 9-其他';
-- 2020 01-13
-- 公会分成比例申请记录
CREATE TABLE `tab_promote_game_ratio_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`promote_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广员id',
`game_id` int(11) NOT NULL DEFAULT '0' COMMENT '游戏id',
`ratio` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '分成比例',
`last_ratio` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '上次的分成比例',
`last_ratio_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '上次的分成比例状态0-未设置 1-已设置',
`turnover_ratio` varchar(2000) COLLATE utf8mb4_bin NOT NULL COMMENT '流水分成比例',
`last_turnover_ratio` varchar(2000) COLLATE utf8mb4_bin NOT NULL COMMENT '上次流水分成比例',
`begin_time` int(10) NOT NULL DEFAULT '0' COMMENT '开始时间',
`end_time` int(10) NOT NULL DEFAULT '0' COMMENT '过期时间',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '备注',
`status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '审核状态:-1-未通过 0-待审核 1-通过',
`review_time` int(10) NOT NULL DEFAULT '0' COMMENT '审核时间',
`applicant_id` int(11) NOT NULL DEFAULT '0' COMMENT '申请人',
`reviewer_id` int(11) NOT NULL DEFAULT '0' COMMENT '审核人',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `promote_id` (`promote_id`,`game_id`,`status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

@ -1,10 +1,10 @@
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1574318572037'); /* IE9 */
src: url('iconfont.eot?t=1574318572037#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAXEAAsAAAAADNQAAAV3AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEXgqJfIdpATYCJAM8CyAABCAFhG0HgVgb2QrIDiUFOVaVJ6RZZvD85191X1W1MLCyWTi1uxfA72xhR8yYA/oz62izPfv/9736O9OFkN1HsdMmabbwgp1H8tfnH9TVfr/6xRANSRdv9HL3RO8YFhWLNH5CPDGEJOKRoTOEaClFTMKz10xIKn+FiY9DAD/5NMbXu+/g0RCBgY8TQGZOozxExNIwBSGCN9mtuNQgW3HhVevULWCL+/fyg2aJAIVLw0/qH+sjQnebzt7aczxG65lY3eUAi6tAA7UABuS0Mu8oaL+uFg7/7n0MCwGSSYBD2WKX2e0dRR2JV2tfN+vs7ThgY5emrYXWNbaeo3FLIZkU0sSaYc36Bx6gMbhxEUZQePDiw0+AICEQNzCD5LxRHwYbMxEabEEMWCkQN1gZEBdYOxIRho7CRAh0FCEKLAHEA7YbiBdsDxLhg86GRPihsycSAOsFJAjWG30IARCxL8kHyARkECAPYD7T1ZU4xa65pFJUlGJnJien5OYGs6Mmx8Aoja8ZTF4Wd+ZRnmvr43aR0w9zzaYHxevPgrHORcdvuOALTZyPqgifepBjNj9sEzn7ON+15dH44bAqJXXngrT03WlD1yQO7k4dMm7thv3r1RhdmziwIGXyqjTpMWX1hoNBPk6K9IURTN2V1WP9gWDF5H1WA3XOxmDarCY9vnb/nuLg9fu8tuIqa//C9HgtntZO7wVRvt3p/lWpmKGrUwOhazPklDUjnzwZ/fTpmOfPxz17VmroYz0aLX3yhIYKUtODleeww+exeXI4NBLvYGZ652NWfe4MEaf4Fn4c88yeFMcgxqZhWkHESX31GP3smTn06nPf4NJortrwvNuQ1oAsb4zX846x3G3P/g8nhj3TK7Tq4rdvG+woaS5sHhAzorhF0erguqxmax2Z9ubHusxiH6R65zFNd8vau3HjgbyCC3abdZktWbxXWdYHZq/1mZd1XuNJJRfvSt1LL98oSf+cVuLcQrp050C1jXP22LaL+YsLLmzbLsTbMl5wcPu21C5wfeu6dWHTG6eHETHnN3dPj3W7cvRyyP//5rIQm1pq2C3wrOEQd/8hB20zUahUBv3GGW2IlNP08uOzH25mtz3fyrR4vP2Np3r1puF/Nm2X/X88bbmTHSi3SxZBt5tseFYadIuUQTvXlgTVfmXLFoU0NadQw91vNrp3r2FprL1/7pVTc6EpSvfP1Yvbx2rvUH8f1rwDcB7poxq5EddUvu7hp++Ee+o3N7Nug36pYyoiends/KyX6QTSPVRbAAhQ3XULlX/0XP3LOgxx8idOi+/81xv9Z1vw8t/I91TqeAaGaYcXBZWl35FUcZrZK5weMdvJN49AgAitcJ+YHPBLEThUlMzD4Xha5Y4geEkLQeEhDzReSq3GWQsuArSCGy/dwE8N/a4OkIIFhxgfUM1sDYQoR0ER5iZooty2GucDcJHOB3ATFQ78DJXkWwYoF+bvNR/zDhZRoAwxQdeIkelEeZ1HYuoqvBVV3LCx2LJZJWpR35hs7Ic1bHVxhl1MWzoOQcTSVdRXexpWFB0Zll6EBaep5DhGx2YNMdUHNRV0FaLohQWGxwEjgghQBoIhoKNBbO8OUanfHwmG4qLAYxWMuks6FoyFDds5ogVNaV7B2s/UKo06lZ42xVBa4ug1BARZdNRRQfTVczCK1OkgDPVBRWAEHJoiNagx6EgzfTZS1Ww6PFcf9xWAH/6kiCjRYsQlbvGIV3zil4AEJSRhiUiUlBiv0VKm0RLMSl1eK5d0jaZmqKsawhQlbHuo5LJwOkWjoquHH3JahNESdwiwaGOmazcRmCUoOEadpu3a2abLWzhT2mihRm9DKQux51hOpNWmiaiXaOF+rmtEPhitmzjYdgAA') format('woff2'),
url('iconfont.woff?t=1574318572037') format('woff'),
url('iconfont.ttf?t=1574318572037') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1574318572037#iconfont') format('svg'); /* iOS 4.1- */
src: url('iconfont.eot?t=1578289573084'); /* IE9 */
src: url('iconfont.eot?t=1578289573084#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAZsAAsAAAAADuwAAAYfAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFLgqMcIoFATYCJANMCygABCAFhG0HghMbkAwjEWZ8Ukz2FwV2w7GDKqzY1jBxGWfAcQzjHsehHLjHpX1VVVCbrVeqz5/IwQPlfb6ZyZeXKCBkC+pUn4yTT0SSmvl/S82eHmEuW3VNvT3hPhx5HNAPZKlOp6tUhWyFK5F692mhIL6kwmMb8gbnNClDKvSkOHHhqCZPqV3tAMAe5IUtDOyZgcg2XqV/7deqS0i67eGhUOMu3+REl8PMI43LmIck4hGmW2gWCil0dMCmQ/sFVvOIvhsC8JKhGFGvQbN2VNBgWaDFsMEDe1NpWNBmRArculM5U0OswIFbLpRXgeXZ74s3lIkbJA4F36vVgPr9ODOwmqlXG9NNfaBvjgLOeaCAYkADcUV1nUMVlcUovMOX1FgDJAlTuA1h5DeqmdlmQbOwmWeut0pa9axmtg0DIx/5Znmui6pjNR2c6wuSpEgT3wzPLCXfQf0Tz4kbF1ECiULDgxcfQUKERfgJgHBCih++VlUUBhHAAYYAOMHIB3CDkR/gAqMaIAozCyDAzAZIMAsCFJiFARqYeQAPmOsAXjDXm/AN1JIABMGqAwiBVRcQhlUPEIHVFOAHq1knAgDEkvYFQAbERbK2gEOWIElJL7wVq7CqUYbNuklp/mg0lpZgOMNaWiiGU5rmVfTZ/NHJ9ZS3NIPuZBXV1ySdasYTClNA4ZmoRgtIh3PhXnmJ06hWUl59zzLpdtppFxQtq7gIoXLCdjlcjOytnUo0q91LZDhfzUhIMZkYZQJkYiRltAvn90phHi7WV3+Gp3d+UJkrz3KLtpi80jR6FvibkKKaySr1kfnK790pzum0ESKr3Akq9fFsskkMk1uExQmW0tB6OuYFWEZC0QJRVMkWoyoOPKK8v1y2W63abzYd1+tJodQhJ3XcYx4ozzAjaeFJ8srpLjxUaDXYwHi08UEXnei++2u7RUsqI1hx5JKtmwQQkVmKMFsWKbJkg4feQNeD0Vf79X/XwAPunnjBve8e7HO7duv16O2PjTgJ9qjOizY1twDKkXVxe/eru72erbv7vxIJ6pFbytXsV1zZzpawTFaZ1v67nNLZM/IWppTRqwMGv3qzITnHQ/nfqV4jGEmLBGvUSV2BujUbATWrd0iNUCG9Tgf6mCSfuFnAZOU2yRsam/dmZO6jRhuSyybzVvPYGJayIHBByknFzsSTFwfVmnT62MSEj/YmvcKgUxf2zjCwj+7ccTJzQvaJ7k7B+aIDs/f1dnS2AEe3b9jg7FWql9PE0dSJs1ejzZkdp7W/f6nTghMSC1Ub8XnJreStWwriVpNAMAtp2HPUOhiTljj4ean6Rs7yt1cwmT3U7Q1lcXcVK6zZTk92kJEMZdbQdlEns7TVh6U7ZedvqzJrrjYXMHLHc/pY1mMLNWuFVHPOxSiTw5YvH2aK0iYQqq0vFr1+vUi+AZXk/EOH5kOUplXOp7xKA/Lt0r/OzH9PAPux2qGysuS2wvI/YAexE+xzMkPVNoLVhRhd/lSzKzcpQw3QsEi1sNyP5AoVNiV9kTIdAKGylqSj5Bc5X/0f/A19DpV62DN09O3VY5cAuFfp9YgKbNx22wQ3iYXZbz+74BhtxLM11oPRj/ZBgJiF/PuYgldywTZzo/52r8Uv3BwEt/gKSS7pSHHL56n5FkMOPuWQk1tN5FXU7fk+MShP9Awo4stAQtg3koLOIiXsx1Pz/UUOCf6RUzh55NUh/Sv6FIisXSJQDzFZ7ohkRvPQ7mt5y3sQQVGs81n0M6CTJWQ6mrRrbkEDbuIYtxYz7znhaFJyY9wPlDLEolkB86PEe3swHnPtGSNm0kxNXQhQHogRS7skrcQYGnfv1To/fw8IgULhjAGHaZ8B5MjNE1MjkwU8bxW90ICH0t5ZE2Y8UY5E3ZGRIm6IAiWVBmH13VYA440kK5RbB8Y0EV9UGe1eS+//aYAXv3EsOVlRNd0wLdtxPZ9fV0/fIAZLtdhKLTYgt4HqfWK0GPYI3o5cKlVeSZpQM80kbZtKPN0ryLIALeJgynU6LYklrrGUdauCi5hEpqCRSj1s4l4CRehlg3FdyNEWxnZmMK0diwhW7QrOoK/GjaLYbHS5yAy2+kg1jDw4n8kA') format('woff2'),
url('iconfont.woff?t=1578289573084') format('woff'),
url('iconfont.ttf?t=1578289573084') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1578289573084#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
@ -23,6 +23,14 @@
content: "\e721";
}
.iconjiahao1:before {
content: "\e727";
}
.iconjianhao:before {
content: "\e729";
}
.iconfanhui:before {
content: "\e600";
}
@ -51,6 +59,14 @@
content: "\e797";
}
.iconminus-square-fill:before {
content: "\e84b";
}
.iconplus-square-fill:before {
content: "\e84c";
}
.iconreply:before {
content: "\e82f";
}

File diff suppressed because one or more lines are too long

@ -26,6 +26,12 @@ Created by iconfont
<glyph glyph-name="fangxingxuanzhongfill" unicode="&#59169;" d="M832 799.99914l-640 0c-52.9288 0-96.00086-43.07206-96.00086-96.00086l0-640c0-52.92708 43.07206-95.99914 96.00086-95.99914l640 0c52.92708 0 95.99914 43.07206 95.99914 95.99914l0 640C928.00086 756.9288 884.9288 799.99914 832 799.99914zM727.231286 457.567746 471.00766 198.560839c-0.063647-0.063647-0.192662-0.096331-0.25631-0.192662-0.096331-0.063647-0.096331-0.192662-0.192662-0.25631-2.048757-1.983389-4.575729-3.19957-6.944443-4.544765-1.183497-0.672598-2.143368-1.696116-3.392232-2.176052-3.839484-1.536138-7.904314-2.33603-11.967424-2.33603-4.095794 0-8.224271 0.799892-12.096439 2.399677-1.279828 0.543583-2.303346 1.632469-3.519527 2.303346-2.368714 1.343475-4.832039 2.528692-6.880796 4.544765-0.063647 0.063647-0.096331 0.192662-0.159978 0.25631-0.063647 0.096331-0.192662 0.096331-0.25631 0.192662l-126.016611 129.503454c-12.320065 12.672705-12.032791 32.928047 0.639914 45.248112 12.672705 12.287381 32.895364 12.063755 45.248112-0.639914l103.26354-106.112189 233.279613 235.808305c12.416396 12.576374 32.704421 12.672705 45.248112 0.25631C739.520387 490.368499 739.647682 470.111437 727.231286 457.567746z" horiz-adv-x="1024" />
<glyph glyph-name="jiahao1" unicode="&#59175;" d="M863.328262 414.659105l-317.344013-0.099772L545.984249 733.183174c0 17.664722-14.336138 32.00086-32.00086 32.00086s-31.99914-14.336138-31.99914-32.00086l0-318.400215-322.368714 0.17718c-0.032684 0-0.063647 0-0.096331 0-17.632039 0-31.935493-14.239806-32.00086-31.904529-0.096331-17.664722 14.208843-32.031824 31.871845-32.095471l322.59234-0.17718 0-319.167424c0-17.695686 14.336138-32.00086 31.99914-32.00086s32.00086 14.303454 32.00086 32.00086L545.982529 350.559333l317.087703 0.099772c0.063647 0 0.096331 0 0.127295 0 17.632039 0 31.935493 14.239806 32.00086 31.904529S880.960301 414.595458 863.328262 414.659105z" horiz-adv-x="1024" />
<glyph glyph-name="jianhao" unicode="&#59177;" d="M863.74455 351.99914 163.424056 351.99914c-17.664722 0-32.00086 14.336138-32.00086 32.00086s14.336138 32.00086 32.00086 32.00086l700.320495 0c17.695686 0 31.99914-14.336138 31.99914-32.00086S881.440237 351.99914 863.74455 351.99914z" horiz-adv-x="1024" />
<glyph glyph-name="fanhui" unicode="&#58880;" d="M532.526499-8.817574L139.506311 384.202615 532.526499 777.222803c12.258185 12.258185 12.432147 32.892131-0.187265 45.51052-12.707416 12.707416-32.995485 12.703323-45.511543 0.187265L75.166957 411.260877c-7.120165-7.120165-10.163477-17.065677-8.990768-26.624381-1.500167-9.755178 1.5104-20.010753 8.990768-27.491121l411.660734-411.660734c12.258185-12.258185 32.892131-12.432147 45.511543 0.187265 12.707416 12.707416 12.7023 32.995485 0.187265 45.51052z" horiz-adv-x="1024" />
@ -47,6 +53,12 @@ Created by iconfont
<glyph glyph-name="plus-square" unicode="&#59287;" d="M328 352h152v-152c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8V352h152c4.4 0 8 3.6 8 8v48c0 4.4-3.6 8-8 8H544V568c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-152H328c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8zM880 784H144c-17.7 0-32-14.3-32-32v-736c0-17.7 14.3-32 32-32h736c17.7 0 32 14.3 32 32V752c0 17.7-14.3 32-32 32z m-40-728H184V712h656v-656z" horiz-adv-x="1024" />
<glyph glyph-name="minus-square-fill" unicode="&#59467;" d="M880 784H144c-17.7 0-32-14.3-32-32v-736c0-17.7 14.3-32 32-32h736c17.7 0 32 14.3 32 32V752c0 17.7-14.3 32-32 32zM704 360c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48z" horiz-adv-x="1024" />
<glyph glyph-name="plus-square-fill" unicode="&#59468;" d="M880 784H144c-17.7 0-32-14.3-32-32v-736c0-17.7 14.3-32 32-32h736c17.7 0 32 14.3 32 32V752c0 17.7-14.3 32-32 32zM704 360c0-4.4-3.6-8-8-8H544v-152c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8V352H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152V568c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-152h152c4.4 0 8-3.6 8-8v-48z" horiz-adv-x="1024" />
<glyph glyph-name="reply" unicode="&#59439;" d="M398.208 593.088V832L0 413.888l398.208-418.176V240.64c284.48 0 483.584-95.552 625.792-304.64-56.896 298.688-227.584 597.312-625.792 657.088z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Loading…
Cancel
Save