->field("IFNULL(SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END),0) as cash_count,IFNULL(SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END),0) as balance_coin_count")
@ -265,7 +266,8 @@ class FinancialSummarySetController extends \Think\Controller
@ -328,6 +328,7 @@ class StatementMangementController extends ThinkController
->join('tab_reward_detail as rd on rd.record_id = r.id', 'LEFT')
->where($map)
->group('r.id')
// ->order('create_time DESC')
->select();
if ($result) {
@ -349,7 +350,9 @@ class StatementMangementController extends ThinkController
rd.id as rid, rd.type as detail_type, rd.company_type as detail_company_type, rd.company_id as detail_company_id , rd.company_name as detail_company_name, rd.settlement_type as detail_settlement_type, rd.promote_account as detail_promote_account,rd.amount as detail_amount
')
->where($map)
->join('tab_reward_detail as rd on rd.record_id = r.id', 'LEFT')->select();
->join('tab_reward_detail as rd on rd.record_id = r.id', 'LEFT')
->order('create_time DESC')
->select();
if ($list) {
$record = [];
foreach ($list as $item) {
@ -397,7 +400,7 @@ class StatementMangementController extends ThinkController
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,pay_way,market_admin_id,0 is_settlement")
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,pay_way,market_admin_id,0 is_settlement,is_check")
->join("left join tab_promote on tab_spend.promote_id = tab_promote.id")
->join("left join tab_game game on game.id=tab_spend.game_id")
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,pay_way,market_admin_id,1 is_settlement")
CASE WHEN substring_index(substring_index(`chain`,'/',2),'/',-1) !='' THEN substring_index(substring_index(`chain`,'/',2),'/',-1) ELSE promote_id END promote_id,pay_way,market_admin_id,1 is_settlement,is_check")
->join("left join tab_promote on tab_spend.promote_id = tab_promote.id")
->join("left join tab_game game on game.id=tab_spend.game_id")