|
|
@ -20,15 +20,22 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$model = M($this->modelName, 'tab_');
|
|
|
|
$model = M($this->modelName, 'tab_');
|
|
|
|
$map = [];
|
|
|
|
$map = [];
|
|
|
|
|
|
|
|
$promotemap=[];
|
|
|
|
$company_name = trim(I('company_name'));
|
|
|
|
$company_name = trim(I('company_name'));
|
|
|
|
|
|
|
|
if($company_name) $map['tab_promote_company.company_name'] = array('like',"%{$company_name}%");
|
|
|
|
if($company_name)
|
|
|
|
|
|
|
|
$map['tab_promote_company.company_name'] = array('like',"%{$company_name}%");
|
|
|
|
|
|
|
|
if (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') {
|
|
|
|
if (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') {
|
|
|
|
$status = intval($_REQUEST['status']);
|
|
|
|
$status = intval($_REQUEST['status']);
|
|
|
|
$map['tab_promote_company.status'] = $status;
|
|
|
|
$map['tab_promote_company.status'] = $status;
|
|
|
|
$parameter['status'] = $status;
|
|
|
|
$parameter['status'] = $status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_REQUEST['promote_id'])) {
|
|
|
|
|
|
|
|
$map['id'] = M("Promote","tab_")->field("company_id")->where("id={$_REQUEST['promote_id']}")->find()['company_id'];
|
|
|
|
|
|
|
|
$promotemap['id']=$_REQUEST['promote_id'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_REQUEST['company_type'])) {
|
|
|
|
|
|
|
|
$map['company_type'] = $_REQUEST['company_type'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$page = intval(I('get.p', 0));
|
|
|
|
$page = intval(I('get.p', 0));
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据
|
|
|
@ -43,17 +50,11 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
//获取公司id
|
|
|
|
//获取公司id
|
|
|
|
$companyids = implode(',', array_column($companyres, 'id'));
|
|
|
|
$companyids = implode(',', array_column($companyres, 'id'));
|
|
|
|
// //处理公司数据
|
|
|
|
|
|
|
|
// $company = array();
|
|
|
|
|
|
|
|
// foreach($companyres as $k=>$v){
|
|
|
|
|
|
|
|
// $company[]
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//获取所属会长及其游戏分成
|
|
|
|
//获取所属会长及其游戏分成
|
|
|
|
|
|
|
|
$promotemap['company_id']=["in",$companyids];
|
|
|
|
$promoteres = M("Promote","tab_")
|
|
|
|
$promoteres = M("Promote","tab_")
|
|
|
|
->field("id,company_id,account,settlement_type")
|
|
|
|
->field("id,company_id,account,settlement_type")
|
|
|
|
->where(array(
|
|
|
|
->where($promotemap)
|
|
|
|
"company_id"=>["in",$companyids]
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
//获取会长id
|
|
|
|
//获取会长id
|
|
|
|
$promoteids = implode(',', array_column($promoteres, 'id'));
|
|
|
|
$promoteids = implode(',', array_column($promoteres, 'id'));
|
|
|
@ -188,6 +189,7 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
$this->assign('listData', $companyres);
|
|
|
|
$this->assign('listData', $companyres);
|
|
|
|
$this->assign('count', $count);
|
|
|
|
$this->assign('count', $count);
|
|
|
|
|
|
|
|
$this->assign('promoteList', getPromoteByLevel(1));
|
|
|
|
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find());
|
|
|
|
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find());
|
|
|
|
$this->meta_title = '推广公司';
|
|
|
|
$this->meta_title = '推广公司';
|
|
|
|
$this->display();
|
|
|
|
$this->display();
|
|
|
@ -211,6 +213,9 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
$save = I('post.');//前端已经验证
|
|
|
|
$save = I('post.');//前端已经验证
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
$save['last_up_time'] = $time;
|
|
|
|
$save['last_up_time'] = $time;
|
|
|
|
|
|
|
|
$save['contact_begin']=strtotime($save['contact_begin']);
|
|
|
|
|
|
|
|
$save['contact_end']=strtotime($save['contact_end']);
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($save['resources'])){
|
|
|
|
if(isset($save['resources'])){
|
|
|
|
$save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE);
|
|
|
|
$save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|