@ -20,7 +20,7 @@ use Com\WechatAuth;
class PayChannelIntentionController extends AdminController
{
public static $arr_pay_way = ['alipay'=>'支付宝','wxpay'=>'微信支付','sqshorcut'=>'双乾快捷支付','shorcut '=>'易宝支付'];
public static $arr_pay_way = ['alipay'=>'支付宝','wxpay'=>'微信支付','sqpay'=>'双乾快捷支付','yeepay '=>'易宝支付'];
public function index($p = 0) {
@ -54,58 +54,59 @@ class PayChannelIntentionController extends AdminController
$show_data = M('pay_channel_intention','tab_')
->field('group_concat(tab_pay_channel_intention.`pay_way` ORDER BY tab_pay_channel_intention.create_time ASC) as pay_ways,tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
tab_pay_channel_intention.pay_amount,CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,tab_pay_channel_intention.pay_order_number')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);
$data = M()->table('('.$show_data.') as a')
->field('pay_ways,user_account,
->field('pay_ways,user_account,pay_status,
SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
count(if(pay_status=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
->page($page,$row)
->where($map)
->group('a.pay_ways,a.user_account,a.pay_status')
->select();
->select(false );
// $data = M()->table('('.$show_ data.') as a')
// ->field('pay_ways,user_acc ount,
// SUM(if(pay_status=0,pay_amount,0)) fail _invest_amount,
// SUM(if(pay_status=1,pay_amount,0)) success _invest_amount,
// SUM(if(pay_status=2,pay_amount,0)) nothing_invest_am ount,
// count(if(pay_status=0,pay_amount,null)) fail _invest_count,
// count(if(pay_status=1,pay_amount,null)) success_invest_count,
// count(if(pay_status=2,pay_amount,null)) nothing_invest_count' )
// ->page($page,$row )
// ->group('a.pay_ways')
// ->select();
$data = M()->table('('.$data.') as a')
->field('pay_ways,sum(fail_invest_amount) fail_invest_am ount,
sum(success_invest_amount) success _invest_amount,
sum(nothing_invest_amount) nothing _invest_amount,
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_c ount,
count(if(pay_status=1,success_invest_count,NULL)) success _invest_count,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count')
->page($page,$row )
->where($map )
->group('a.pay_ways')
->select();
$sum = M()->table('('.$show_data.') as a')
->field('pay_ways,user_account,
->field('pay_ways,user_account,pay_status,
SUM(if(pay_status=0,pay_amount,0)) fail_invest_amount,
SUM(if(pay_status=1,pay_amount,0)) success_invest_amount,
SUM(if(pay_status=2,pay_amount,0)) nothing_invest_amount,
count(if(pay_status=0,pay_amount,null)) fail_invest_count,
count(if(pay_status=1,pay_amount,null)) success_invest_count,
count(if(pay_status=2,pay_amount,null)) nothing_invest_count')
->group('a.pay_way s')
->group('a.user_account,a.pay_statu s')
->select(false);
$sum = M()->table('('.$sum.') as a')
->field(" sum(fail_invest_amount) fail_invest_amount,
->field('pay_ways, sum(fail_invest_amount) fail_invest_amount,
sum(success_invest_amount) success_invest_amount,
sum(nothing_invest_amount) nothing_invest_amount,
sum(fail_invest_count) fail_invest_count,
sum(success_invest_count) success_invest_count,
sum(nothing_invest_count) nothing_invest_count")
count(if(pay_status=0,fail_invest_count,NULL)) fail_invest_count,
count(if(pay_status=1,success_invest_count,NULL)) success_invest_count,
count(if(pay_status=2,nothing_invest_count,NULL)) nothing_invest_count')
->where($map)
->find();
$this->assign('sum',$sum);
$count = M()->table('('.$show_data.') as a')
@ -311,14 +312,16 @@ class PayChannelIntentionController extends AdminController
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);
// var_dump($data);die();
$count = M()->table('('.$data.') as a')
->where($map)
->count();
@ -342,10 +345,10 @@ class PayChannelIntentionController extends AdminController
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);
@ -403,10 +406,10 @@ class PayChannelIntentionController extends AdminController
count(if(tab_pay_channel_intention.pay_way="shorcut",tab_pay_channel_intention.pay_way,null)) shorcut,
tab_pay_channel_intention.user_account,
tab_pay_channel_intention.pay_amount,
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_status END as pay_status,
CASE WHEN is_submit = 0 THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);
@ -481,7 +484,7 @@ class PayChannelIntentionController extends AdminController
CASE WHEN pay_status is null THEN 2 ELSE pay_status END as pay_status,
CASE WHEN pay_game_status is null THEN 2 ELSE pay_game_status END as pay_game_status,
tab_pay_channel_intention.pay_order_number,tab_pay_channel_intention.create_time')
->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
// ->join('left join tab_spend on tab_pay_channel_intention.pay_order_number=tab_spend.pay_order_number')
->group('tab_pay_channel_intention.pay_order_number')
->order('tab_pay_channel_intention.create_time ASC')
->select(false);