diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index bac1bc18c..742036f1f 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -75,6 +75,11 @@ class FinancePromoteController extends AdminController $nwtflag = false; } } + if(isset($_REQUEST['develop_type'])){ + if($_REQUEST['develop_type']!=0){ + $nwtflag = false; + } + } if(isset($_REQUEST['admin_id'])){ if($_REQUEST['admin_id']!=0){ $nwtflag = false; @@ -183,12 +188,15 @@ class FinancePromoteController extends AdminController $outBelong = 0; $insideBelong = 0; + $otherBelong = 0; foreach ($data as $key => $value) { if ($value['company_belong']=='内团') { $insideBelong+=$value['allcount']; - } else { + } elseif ($value['company_belong']=='外团' || $value['company_belong']=='外团-分发') { $outBelong+=$value['allcount']; + } else { + $otherBelong+=$value['allcount']; } } @@ -205,7 +213,7 @@ class FinancePromoteController extends AdminController $this->assign('outBelong',number_format($outBelong/$count['all_count']*100,2,'.','')); //内团占比 $this->assign('insideBelong',number_format($insideBelong/$count['all_count']*100,2,'.','')); - + $this->assign('otherBelong',number_format($otherBelong/$count['all_count']*100,2,'.','')); $size = $row; $data = array_slice($data, ($arraypage - 1) * $size, $size); $this->assign('list_data', $data); @@ -347,6 +355,11 @@ class FinancePromoteController extends AdminController //获取各会长的现金充值 $map=[]; $title = ''; + + if (!empty(I('develop_type'))) { + $map['company.develop_type'] = I('develop_type'); + } + self::setPromoteMap($map,"s.promote_id",$title); $title .= "渠道统计"; $this->assign('title', $title); @@ -1205,12 +1218,10 @@ class FinancePromoteController extends AdminController $title .= (getCompanyBlong($_REQUEST['company_belong'])."-"); } - if (!empty(I('develop_type'))) { - $map['company.develop_type'] = I('develop_type'); - if(I('develop_type') != 0){ - $gfflg = false; - } + if (I('develop_type', 0) != 0) { + $gfflg = false; } + if (!empty(I('admin_id'))) { if(I('admin_id') != 0){ $gfflg = false; diff --git a/Application/Admin/Controller/MarketController.class.php b/Application/Admin/Controller/MarketController.class.php index f0a69f1de..cf519b886 100644 --- a/Application/Admin/Controller/MarketController.class.php +++ b/Application/Admin/Controller/MarketController.class.php @@ -48,8 +48,7 @@ class MarketController extends ThinkController if (count($recordCompanyIds) > 0) { $recordCompanys = M('promote_company', 'tab_')->field(['id', 'company_name', 'company_belong'])->where(['id' => ['in', $recordCompanyIds]])->select(); } - $adminIds = array_merge(array_column($items, 'from_id'), array_column($items, 'to_id')); - $recordAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $adminIds]])->select(); + $recordAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select(); $recordPromotes = index_by_column('id', $recordPromotes); $recordCompanys = index_by_column('id', $recordCompanys); $recordAdmins = index_by_column('id', $recordAdmins); @@ -82,7 +81,8 @@ class MarketController extends ThinkController 'split_time' => $item['split_time'] == 0 ? '全部' : date('Y-m-d H:i:s', $item['split_time']), 'created_time' => date('Y-m-d H:i:s', $item['created_time']), 'status_text' => $statusList[$item['status']], - 'status' => $item['status'] + 'status' => $item['status'], + 'creator_username' => isset($recordAdmins[$item['creator_id']]) ? $recordAdmins[$item['creator_id']]['username'] : '未知', ]; } $companys = M('promote_company', 'tab_')->field(['id', 'company_name'])->where(['company_belong' => ['in', [1, 2]]])->select(); @@ -99,8 +99,17 @@ class MarketController extends ThinkController public function rebind() { $this->meta_title = '新增换绑'; + $companyTypes = [ + 0 => '内团', + 1 => '外团', + 2 => '外团-分发联盟', + 3 => '无' + ]; $id = I('id', 0); - $companys = M('promote_company', 'tab_')->field(['id', 'company_name'])->where(['company_belong' => ['in', [1, 2]]])->select(); + $companys = M('promote_company', 'tab_')->field(['id', 'company_name', 'company_belong'])->where(['company_belong' => ['in', [1, 2]]])->select(); + foreach ($companys as &$company) { + $company['company_belong'] = $companyTypes[$company['company_belong']] ?? '未知'; + } $marketAdmins = getMarketAdmins(); $this->assign('companys', $companys); $this->assign('marketAdmins', $marketAdmins); diff --git a/Application/Admin/View/FinancePromote/index.html b/Application/Admin/View/FinancePromote/index.html index 0b748e630..5c6704951 100644 --- a/Application/Admin/View/FinancePromote/index.html +++ b/Application/Admin/View/FinancePromote/index.html @@ -282,7 +282,7 @@