master
ELF 4 years ago
parent 7614d5feca
commit ad2037408d

@ -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;

@ -152,12 +152,13 @@
<th>内外团</th>
<th>开发类型</th>
<th>公司性质</th>
<th>是否签署合同</th>
<th width="80">是否<br>签署合同</th>
<th>结算周期</th>
<th width="100">押金</th>
<th>会长账号</th>
<th>市场专员</th>
<th>押金</th>
<!-- <th>押金</th> -->
<th>原包名</th>
<th>现包名</th>
<th>产品类型</th>
@ -185,10 +186,11 @@
<td rowspan="{$data.row}">{$data.is_sign_contact}</td>
<td rowspan="{$data.row}">{$data.settlement_type}</td>
<td rowspan="{$data.row}">{$data.deposit_pay_type}</td>
<notempty name="data.list">
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['account']|default="--"}</td>
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['market_admin_username']|default="--"}</td>
<td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['pay_type']|default="--"}</td>
<!-- <td rowspan="{$data['list'][0]['row']}">{$data['list'][0]['pay_type']|default="--"}</td> -->
<notempty name="data['list'][0]['list']">
<td rowspan="{$data['list'][0]['list'][0]['row']}">{$data['list'][0]['list'][0]['original_package_name']|default="--"}</td>

Loading…
Cancel
Save