|
|
|
@ -111,6 +111,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
"inside_cash_count"=>0,
|
|
|
|
|
);
|
|
|
|
|
foreach($senddata as $k=>$v){
|
|
|
|
|
$v['company_belong'] = $v['company_belong'] ?:0;
|
|
|
|
|
$v['company_belong'] = getCompanyBlong($v['company_belong']);
|
|
|
|
|
if(empty($v['company_name'])) $v['company_name']= $this->COMPANY_NAME;
|
|
|
|
|
if(empty($v['p_id'])) $v['p_id']= "0";
|
|
|
|
@ -213,7 +214,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id,
|
|
|
|
|
IFNULL(company_id,0) company_id,company_name,IFNULL(promote.company_belong,0) company_belong";
|
|
|
|
|
return M()
|
|
|
|
|
->table("tab_spend s")
|
|
|
|
|
->table("tab_spend s use index(promote_time)")
|
|
|
|
|
->field($field)
|
|
|
|
|
->where($map)
|
|
|
|
|
->join("tab_promote promote ON s.promote_id = promote.id","left")
|
|
|
|
@ -372,7 +373,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count,
|
|
|
|
|
IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,IFNULL(promote.company_belong,0) company_belong";
|
|
|
|
|
return M()
|
|
|
|
|
->table("tab_spend s")
|
|
|
|
|
->table("tab_spend s use index(promote_time)")
|
|
|
|
|
->field($field)
|
|
|
|
|
->where($map)
|
|
|
|
|
->join("tab_promote promote ON s.promote_id = promote.id", "left")
|
|
|
|
@ -788,7 +789,7 @@ class FinancePromoteController extends AdminController
|
|
|
|
|
if($_REQUEST['promote_id'] == 0){
|
|
|
|
|
$isgf = true;
|
|
|
|
|
}
|
|
|
|
|
$map['s.promote_id'] = $_REQUEST['promote_id'];
|
|
|
|
|
$map['s.promote_id'] = array("in",implode(",",array_column(getPrmoteChlidAccount($_REQUEST['promote_id'],"id"),"id")).",".$_REQUEST['promote_id']);
|
|
|
|
|
}
|
|
|
|
|
//检索
|
|
|
|
|
if (isset($_REQUEST['sn'])) {
|
|
|
|
|