|
|
|
@ -73,18 +73,11 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
|
|
|
|
|
if (isset($_REQUEST['pay_type'])) {
|
|
|
|
|
$pay_type = $_REQUEST['pay_type'];
|
|
|
|
|
$promote_id = M("president_deposit","tab_")->where("pay_type = '$pay_type'")->group("promote_id")->getField("promote_id",true);
|
|
|
|
|
if(empty($promote_id)){
|
|
|
|
|
$promote_id = -1;
|
|
|
|
|
}
|
|
|
|
|
$promote_id = implode(",",$promote_id);
|
|
|
|
|
|
|
|
|
|
$c_id = throwPromoteIdToCompanyId($promote_id);
|
|
|
|
|
if(isset($promotemap["_string"])){
|
|
|
|
|
$promotemap["_string"] .= " ADN p.id in ($promote_id)";
|
|
|
|
|
}else{
|
|
|
|
|
$promotemap["_string"] = "p.id in ($promote_id)";
|
|
|
|
|
$c_id = M("president_deposit","tab_")->where("pay_type = '$pay_type'")->group("company_id")->getField("company_id",true);
|
|
|
|
|
if(empty($c_id)){
|
|
|
|
|
$c_id = -1;
|
|
|
|
|
}
|
|
|
|
|
$c_id = implode(",", $c_id);
|
|
|
|
|
if(isset($map["_string"])){
|
|
|
|
|
$map["_string"] .= " ADN id in ($c_id)";
|
|
|
|
|
}else{
|
|
|
|
@ -109,11 +102,23 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
}else{
|
|
|
|
|
$companyres = $companyres->page($page,$row)->select();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$payWays = PresidentDepositService::$payWays;
|
|
|
|
|
$payTypes = PresidentDepositService::$payTypes;
|
|
|
|
|
$statusList = PresidentDepositService::$statusList;
|
|
|
|
|
|
|
|
|
|
//获取公司信息
|
|
|
|
|
if(!empty($companyres)){
|
|
|
|
|
|
|
|
|
|
$companyIds = array_column($companyres, 'id') ;
|
|
|
|
|
$depositList = M('president_deposit', 'tab_')->field(['company_id', 'pay_type'])->where(['company_id' => ['in', $companyIds]])->select();
|
|
|
|
|
$depositList = index_by_column('company_id', $depositList);
|
|
|
|
|
|
|
|
|
|
foreach($companyres as $k=>&$v){
|
|
|
|
|
$deposit = $depositList[$v['id']] ?? null;
|
|
|
|
|
$tmpr = D("CompanyRelation")->getCompanyRelation(2,$v['id']);
|
|
|
|
|
$v["settlement_type"] = $tmpr['settlement_type'];
|
|
|
|
|
$v["deposit_pay_type"] = $deposit ? $payTypes[$deposit['pay_type']] : '--';
|
|
|
|
|
$v["collection"] = $tmpr['collection'];
|
|
|
|
|
$v["invoice_type"] = $tmpr['invoice_type'];
|
|
|
|
|
$v["invoice_content"] = $tmpr['invoice_content'];
|
|
|
|
@ -1333,10 +1338,6 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
protected function getPromoteGameRadio($company_id,$ratio,$p_map = false){
|
|
|
|
|
//获取会长信息
|
|
|
|
|
$payWays = PresidentDepositService::$payWays;
|
|
|
|
|
$payTypes = PresidentDepositService::$payTypes;
|
|
|
|
|
$statusList = PresidentDepositService::$statusList;
|
|
|
|
|
|
|
|
|
|
$rdata = [];
|
|
|
|
|
$promotemap['p.company_id']=$company_id;
|
|
|
|
|
$promotemap['p.level'] = 1;
|
|
|
|
@ -1347,8 +1348,7 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
|
|
|
|
|
$promoteres = M("Promote","tab_")
|
|
|
|
|
->alias('p')
|
|
|
|
|
->field("p.id,p.company_id,p.account,p.game_ids,d.amount,IFNULL(d.pay_way,-1) pay_way,d.status,d.pay_type")
|
|
|
|
|
->join("tab_president_deposit as d ON p.id = d.promote_id","left")
|
|
|
|
|
->field("p.id,p.company_id,p.account,p.game_ids")
|
|
|
|
|
->where($promotemap)
|
|
|
|
|
->select();
|
|
|
|
|
// dd($promoteres);
|
|
|
|
@ -1360,15 +1360,6 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
|
|
|
|
|
foreach ($promoteres as $k => &$v) {
|
|
|
|
|
$v['market_admin_username'] = isset($adminList[$v['id']]) && $adminList[$v['id']]['admin'] ? $adminList[$v['id']]['admin']['username'] : '无';
|
|
|
|
|
if($v['pay_way'] == -1){
|
|
|
|
|
$v['pay_way'] = "--";
|
|
|
|
|
$v['status'] = "--";
|
|
|
|
|
$v['pay_type']="--";
|
|
|
|
|
}else{
|
|
|
|
|
$v['status'] = $statusList[$v['status']] ?? '--';
|
|
|
|
|
$v['pay_type'] = $payTypes[$v['pay_type']] ?? '--';
|
|
|
|
|
$v['pay_way'] = $payWays[$v['pay_way']] ?? '--';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($ratio == false || empty($v['game_ids'])){
|
|
|
|
|
$v['row']=1;
|
|
|
|
|