商户bug修改

master
zhengyongxing 4 years ago
parent 624a2b7cde
commit a960e0a7e4

@ -2847,12 +2847,22 @@ function throwPromoteIdToCompanyId($p_ids)
* @param $type
* @return mixed
*/
function getMerchant(){
function getMerchant($type = 0){
if ($type) {
$data = M('payment_merchant','tab_')
->field("id,name,identifier,account,main_name")
->where(['status'=>1,'type'=>1])
->group("main_name")
->select();
} else {
$data = M('payment_merchant','tab_')
->field("id,name,identifier,account,main_name")
->where(['status'=>1,'type'=>1])
->select();
}
return $data;
}
@ -2885,7 +2895,7 @@ function getCpCompanySelect($type = 1){
*/
function getMerchantList($type = 1){
$data = M("payment_merchant","tab_")->field("id,name")->select();
$data = M("payment_merchant","tab_")->field("id,name,ways")->select();
return $data;
}

@ -15,9 +15,9 @@ class PayMerchantController extends ThinkController
const WAY_EXPRESS = 4;
public function index($p = 0) {
// if(!array_key_exists("timestart",$_REQUEST)){
// $this->redirect(ACTION_NAME, array('timestart' => date('Y-m-d',strtotime('-30 day')),"timeend"=>date('Y-m-d')));
// }
if(!array_key_exists("timestart",$_REQUEST)){
$this->redirect(ACTION_NAME, array('timestart' => date('Y-m-d',strtotime('-30 day')),"timeend"=>date('Y-m-d')));
}
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$arraypage = $page;
@ -156,7 +156,7 @@ class PayMerchantController extends ThinkController
->group("merchant_id,merchant_way")
->select();
}
// dump($data);die();
$count = M()->table("({$sql})a")
->field("merchant_id")
->where("name is not null and merchant_way !=0")
@ -187,7 +187,7 @@ class PayMerchantController extends ThinkController
$sum['offcial_amount'] = round ($sum['offcial_amount'],2);
$sum['spread_amount'] = round ($sum['spread_amount'],2);
$sum['offcial_amount'] = round ($sum['supersign_amount'],2);
$sum['spread_amount'] = round ($sum['test_order_amount'],2);
$sum['test_order_amount'] = round ($sum['test_order_amount'],2);
$sum['sum'] = $sum['cash_amount']+$sum['test_amount']+$sum['coin_amount']+$sum['offcial_amount']
@ -207,6 +207,14 @@ class PayMerchantController extends ThinkController
$value['offcial_amount']+$value['spread_amount']+$value['supersign_amount']+$value['test_order_amount'];
$data[$key]['ratio'] = round (($data[$key]['sum']/array_sum(array_column($sum_merchant,'sum_amount')))*100,2);
$data[$key]['cash_amount'] = number_format($value['cash_amount'],2,'.','');
$data[$key]['test_amount'] = number_format ($value['test_amount'],2,'.','');
$data[$key]['coin_amount'] = number_format ($value['coin_amount'],2,'.','');
$data[$key]['offcial_amount'] = number_format ($value['offcial_amount'],2,'.','');
$data[$key]['spread_amount'] = number_format ($value['spread_amount'],2,'.','');
$data[$key]['offcial_amount'] = number_format ($value['supersign_amount'],2,'.','');
$data[$key]['test_order_amount'] = number_format ($value['test_order_amount'],2,'.','');
if ($value['merchant_way'] == self::WAY_ALIPAY) {
$data[$key]['merchant_way'] = "支付宝";
} else if ($value['merchant_way'] == self::WAY_WEIXIN) {

@ -91,14 +91,6 @@ class TestOrderController extends ThinkController
$this->ajaxReturn(['status'=>0,'msg'=>'订单重复录入']);
}
if ($data['pay_way'] == 1) {
$data['merchant_way'] = 1;
} else if($data['pay_way'] == 2||$data['pay_way'] == 3) {
$data['merchant_way'] = 2;
} else {
$data['merchant_way'] = 4;
}
$isSuccess = M('test_order','tab_')->add($data);
if ($isSuccess) {

@ -146,9 +146,9 @@
<th ><div class="tooltip">平台币直充金额<span class="tooltiptext"><span style="margin-left: -10px">玩家在游戏内充值到SDK(余额-平台币)内平台币的金额</span></span></div></th>
<th ><div class="tooltip">测试白名单测试金额<span class="tooltiptext"><span style="margin-left: -10px">测试白名单下测试账号所产生的测试金额。只展示充值成功的订单</span></span></div></th>
<th ><div class="tooltip">测试白名单金额<span class="tooltiptext"><span style="margin-left: -10px">测试白名单下测试账号所产生的测试金额。只展示充值成功的订单</span></span></div></th>
<th ><div class="tooltip">支付渠道内合<span class="tooltiptext"><span style="margin-left: -10px">超级签金额+游戏现金金额+平台币直充+测试金额</span></span></div></th>
<th ><div class="tooltip">支付商户内统<span class="tooltiptext"><span style="margin-left: -10px">超级签金额+游戏现金金额+平台币直充+测试金额</span></span></div></th>
<th >操作</th>
</tr>

@ -110,7 +110,7 @@
<div class="input-list input-list-game search_label_rehab">
<select id="main_name" name="main_name" class="select_gallery" >
<option value="">请选择商户主体</option>
<volist name=":getMerchant()" id="vo">
<volist name=":getMerchant(1)" id="vo">
<option value="{$vo.main_name}" <if condition="$vo.main_name eq I('main_name')">selected</if> >{$vo.main_name}</option>
</volist>
</select>
@ -205,8 +205,7 @@
<volist name="listdata" id="data">
<tr>
<td>{$data.main_name|default = '无'}</td>
<td >{$data.name|default = '无'}
<!-- -{$data.merchant_way|default = '无'}-->
<td >{$data.name|default = '无'}({$data.merchant_way|default = '无'})
</td>
<td >{$data.account|default = ''}</td>
<!-- <td >{$data['channel']|default = ''}</td>-->
@ -243,7 +242,7 @@
</if>
<volist name="sum_merchant" id="sum_merchant">
{$sum_merchant.name}{$sum_merchant.sum_amount|default = '0.00'} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
{$sum_merchant.name}({$sum_merchant.merchant_way}){$sum_merchant.sum_amount|default = '0.00'} &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
</volist>
</td>
</tr>

@ -156,11 +156,20 @@
<td class="r">
<select id="merchant_id" name="merchant_id" class="select_gallery">
<volist name=":getMerchantList()" id="vo">
<option value="{$vo.id}">{$vo.name}</option>
<option value="{$vo.id}" data-way="{$vo.ways}">{$vo.name}</option>
</volist>
</select>
</td>
</tr>
<tr>
<td class="l">商户充值方式:</td>
<td class="r">
<select id="merchant_way" name="merchant_way" class="select_gallery">
<option value=''>请选择商户支付方式</option>
</select>
</td>
</tr>
<tr>
<td class="l">充值时间:</td>
@ -226,6 +235,29 @@
</script>
<script type="text/javascript">
$("#merchant_id").change(function () {
var way = $("#merchant_id option:selected").attr("data-way");
var ways = [];
var option = '';
ways[1] = '支付宝';
ways[2] = '微信';
ways[4] = '快捷支付';
$("#merchant_way").empty();
$("#merchant_way").append("<option value=''>请选择商户支付方式</option>");
ways.forEach(function(val,index,ways){
if ((way & index) == index) {
option = "<option value='"+index+"'>"+ways[index]+"</option>";
$("#merchant_way").append(option);
}
});
});
$("#merchant_id").change();
//搜索功能
$("#jssearch").click(function(){
var starttime = $.trim($('#time-start').val());

Loading…
Cancel
Save