Merge branch 'hotfix/market_percentage' of wmtx/platform into release

市场结算管理bug修正
master
廖金灵 5 years ago committed by Gogs
commit 8711b85d1e

@ -2594,7 +2594,7 @@ function getMarketAdmin() {
$map['group_id'] = ['in','11,12,21'];
$admin_id = $_SESSION['onethink_admin']['user_auth']['uid'];
$map['menber.uid'] = $admin_id;
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) {
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14||session('user_group_id') == 19||session('user_group_id') == 23) {
unset($map['menber.uid']);
}
@ -2790,7 +2790,7 @@ function promote_listsMarket($type){
$admin_id = $_SESSION['onethink_admin']['user_auth']['uid'];
$map['admin_id'] = $admin_id;
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14) {
if(is_administrator()||session('user_group_id') == 15||session('user_group_id') == 14||session('user_group_id') == 19||session('user_group_id') == 23) {
unset($map['admin_id']);
}

@ -748,6 +748,8 @@ class TimingController extends AdminController {
return 9;
case 'yeepay': //易宝支付17
return 17;
case 'ptb_pay':
return 0;
default:
return '';
}
@ -789,7 +791,22 @@ class TimingController extends AdminController {
->where($spend_map)
->group("tab_spend.id")
->select(false);
// var_dump($spend);die();
// $desposit = M("deposit","tab_")
// ->field("sum(pay_amount) as pay_amount,FROM_UNIXTIME(payed_time,'%Y-%m') pay_time,
// substring_index(substring_index(tab_pay_info.game_name,'(',1),'(',-1) game_name,game_id,relation_game_id,tab_deposit.sdk_version,
// CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE tab_pay_info.promote_id END promote_id,tab_deposit.pay_way,market_admin_id")
// ->join("inner join tab_pay_info on tab_pay_info.order_id=tab_deposit.pay_order_number")
// ->join("left join tab_promote on tab_deposit.promote_id = tab_promote.id")
// ->join("left join tab_game game on game.id=tab_pay_info.game_id")
// ->where(['tab_deposit.pay_status'=>1,'tab_deposit.pay_way'=>['egt',1],'pay_source'=>2])
// ->where($spend_map)
// ->group("tab_deposit.id")
// ->select(false);
//
// $spend = "{$spend} UNION ALL {$desposit}";
// var_dump($desposit);die();
$payway_spend = M()->table("({$spend}) spend")
->field("sum(pay_amount) as pay_amount,pay_time,promote_id,game_name,game_id,relation_game_id,pay_way,sdk_version")
->where($map)
@ -800,7 +817,7 @@ class TimingController extends AdminController {
$paywayData = M("tool","tab_")
->field("name,config")
->where(['name'=>['in',"alipay,weixin,wei_xin,wei_xin_app,jubaobar,weixin_gf,jft,jft_wap,goldpig,ptb_pay,bind_pay,sqpay,heepay,yeepay"]])
->where(['name'=>['in',"alipay,weixin,wei_xin,wei_xin_app,jubaobar,weixin_gf,jft,jft_wap,goldpig,ptb_pay,bind_pay,sqpay,heepay,yeepay,ptb_pay"]])
->select();
//公司税费计算
@ -824,10 +841,11 @@ class TimingController extends AdminController {
$pay_rate = [];
foreach ($paywayData as $key => $value) {
$pay_config = json_decode($value['config'],true);
if ($this->getPayway($value['name'])) {
if ($this->getPayway($value['name'])||$this->getPayway($value['name'])=='0') {
$pay_rate[$this->getPayway($value['name'])] = $pay_config['channel_rate']?$pay_config['channel_rate']:0;
}
}
foreach ($payway_spend as $key => $value) {
switch ($value['pay_way']){
@ -1022,15 +1040,40 @@ class TimingController extends AdminController {
}
// echo "{$value['nickname']}:{$value['pay_time']}\n";
// dump($market_percentage);
$all_data[$key]['performance_commission'] =
number_format($value['company_profit']*($market_percentage['develop_commission_ratio']/100) +
$value['company_profit']*($market_percentage['maintain_commission_ratio']/100), 2, '.', '');
$settleup_marketorder = M("settleup_marketorder","tab_")
->where(['admin_id'=>$value['admin_id'],'pay_time'=>$value['pay_time']])
->select();
$all_data[$key]['performance_commission'] = 0;
$all_data[$key]['achievement_bonus'] = 0;
foreach ($settleup_marketorder as $k => $v) {
if($v['develop_type'] == 1 || $v['develop_type'] == 2) {
$all_data[$key]['performance_commission'] += $v['company_profit']*($market_percentage['develop_commission_ratio']/100);
}
if ($v['develop_type'] == 3) {
$all_data[$key]['performance_commission'] += $v['company_profit']*($market_percentage['maintain_commission_ratio']/100);
}
//绩效考核奖金
if($v['develop_type'] == 1 || $v['develop_type'] == 2) {
$all_data[$key]['achievement_bonus'] +=$v['company_profit']*($market_percentage['appraisal_bonuses_ratio']/100);
}
if ($v['develop_type'] == 3) {
$all_data[$key]['achievement_bonus'] += $v['company_profit']*($market_percentage['maintain_appraisal_bonuses_ratio']/100);
}
}
$all_data[$key]['performance_commission'] = number_format($all_data[$key]['performance_commission'], 2, '.', '');
$all_data[$key]['achievement_bonus'] = number_format($all_data[$key]['achievement_bonus'], 2, '.', '');
$sum_amount <$market_percentage['performance_revenue'] ? ($all_data[$key]['performance_commission'] = 0):"";
//绩效考核奖金
$all_data[$key]['achievement_bonus'] =
number_format($value['company_profit']*($market_percentage['appraisal_bonuses_ratio']/100) +
$value['company_profit']*($market_percentage['maintain_appraisal_bonuses_ratio']/100), 2, '.', '');
// $all_data[$key]['achievement_bonus'] =
// number_format($value['company_profit']*($market_percentage['appraisal_bonuses_ratio']/100) +
// $value['company_profit']*($market_percentage['maintain_appraisal_bonuses_ratio']/100), 2, '.', '');
$sum_amount <$market_percentage['appraisal_bonuses'] ? ($all_data[$key]['achievement_bonus'] = 0):"";
//总提成
$all_data[$key]['commission'] = number_format($all_data[$key]['performance_commission']+$all_data[$key]['achievement_bonus'], 2, '.', '');

@ -254,7 +254,7 @@ class ToolController extends ThinkController {
*/
public function payset($value='')
{
$str = "alipay,weixin,wei_xin,wei_xin_app,jubaobar,weixin_gf,jft,jft_wap,goldpig,ptb_pay,bind_pay,sqpay,heepay,yeepay";
$str = "alipay,weixin,wei_xin,wei_xin_app,jubaobar,weixin_gf,jft,jft_wap,goldpig,ptb_pay,bind_pay,sqpay,heepay,yeepay,ptb_pay";
$this->BaseConfig($str);
$this->meta_title = '支付设置';

@ -197,7 +197,7 @@
<tr>
<td class="l">开票内容:</td>
<td class="r table_radio">
<input type="text" name="invoice_content" id="invoice_content" class="input" value="技术服务费"></textarea>
<input type="text" name="invoice_content" id="invoice_content" class="input" value="信息服务费"></textarea>
</td>
</tr>

@ -277,14 +277,14 @@
</td>
<td>
<if condition="$data['pay_status'] eq 1"><span class="game_notice_status_color">{:get_info_status($data['pay_game_status'],14)}</span>
<elseif condition="$data.status eq 0"/>
<elseif condition="$data.pay_status eq 0"/>
— —
<else/>
{:get_info_status($data['pay_game_status'],14)}
</if>
</td>
<td style="text-indent:0;">
<if condition="$data['pay_game_status'] eq 0 and $data['pay_status'] eq 1">
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and $data['pay_status'] eq 1">
<a class=" budan" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/repairEdit')}" style="width:100%;">补单</a>
<else/>
@ -294,7 +294,7 @@
</if>
<br />
<if condition="$data['pay_game_status'] eq 0 and $data['pay_status'] eq 0">
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and ($data['pay_status'] eq 0 or $data['pay_status'] eq 2)">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>

@ -1295,6 +1295,20 @@
</tr>
<tr>
<td class="l noticeinfo">渠道费率</td>
<td class="r">
<input name="config[channel_rate]" type="text" value="{$ptb_pay['channel_rate']}" class="" placeholder="设置支付渠道的的费用比例">
<span class="notice-text">%</span>
</td>
</tr>
</tbody>
</table>

@ -687,12 +687,12 @@ function get_info_status($type=null,$group=0){
6 =>array(0=>"未修复" ,1=>"已修复"),//纠错状态
7 =>array(0=>"失败" ,1=>"成功"),//纠错状态 未修复 已修复
8 =>array(0=>"禁用" ,1=>"启用"),//显示状态 禁用 启用
9 =>array(0=>"下单未支付" ,1=>"充值成功"),//订单状态 下单未支付 充值成功
9 =>array(0=>"下单未支付" ,1=>"充值成功" ,2=>"充值失败"),//订单状态 下单未支付 充值成功
10 =>array(0=>"正常" ,1=>"拥挤",2=>"爆满"),//区服状态 正常 拥挤 饱满
12 =>array(0=>L('Unpaid'),1=>"成功"), // 未支付 成功
30=>array(0=>"待审核",1=>"已审核",2=>"驳回"), //待审核
13 =>array(1=>'已读',2=>"未读"),
14 =>array(0=>"通知失败",1=>"通知成功"),
14 =>array(0=>"通知失败",1=>"通知成功",2=>"通知失败"),
15 =>array(0=>"未充值",1=>"已充值"),
16 =>array(0=>"未回复",1=>"已回复"),
17 =>array(0=>"平台币",1=>"绑定平台币"),

@ -107,7 +107,7 @@
<th style="border-right: solid 1px #b6cad2;">支付宝账号</th>
<th style="border-right: solid 1px #b6cad2;">批次号</th>
<th style="border-right: solid 1px #b6cad2;">金额(元)</th>
<th style="border-right: solid 1px #b6cad2;">备注</th>
<!-- <th style="border-right: solid 1px #b6cad2;">备注</th> -->
<th style="border-right: solid 1px #b6cad2;">打款备注</th>
</tr>
</thead>
@ -120,8 +120,8 @@
<td>{$vo.company_info.ali_account}</td>
<td>{$vo.batch_num}</td>
<td>{$vo.statement_money}</td>
<td>{$vo.remark}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" data-pool="{$vo.pool_id}" name="remark" value="" placeholder="打款备注"></td>
<!-- <td>{$vo.remark}</td> -->
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" data-pool="{$vo.pool_id}" name="remark" value="{$vo.remark}" placeholder="打款备注"></td>
</tr>
</foreach>

Loading…
Cancel
Save