From c3a92821472a8b6ed0d10296ddff85cf904fb3d7 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Tue, 31 Dec 2019 15:13:36 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BC=9A?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E3=80=81=E5=B7=A5=E4=BC=9A=E5=BD=92=E5=B1=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index 391c988f2..6905f484a 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -915,4 +915,7 @@ ADD COLUMN `beta_url` varchar(150) NOT NULL DEFAULT '' COMMENT 'Beta链接'; -- 游戏支付方式渠道配置 ALTER TABLE `tab_game` -ADD COLUMN `pay_config` varchar(255) NOT NULL COMMENT '支付渠道 wx 微信 zfb 支付宝 quick 快捷 (gf 官方 sq 双乾'; \ No newline at end of file +ADD COLUMN `pay_config` varchar(255) NOT NULL COMMENT '支付渠道 wx 微信 zfb 支付宝 quick 快捷 (gf 官方 sq 双乾'; + +ALTER TABLE tab_promote add `company_belong` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会归属:0-内团;1-外团'; +ALTER TABLE tab_promote add `company_relation` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会关系:0-自主开发及维护;1-只维护'; \ No newline at end of file From 1c8f0d446454666560e337e806b0edfb3a8749bc Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Thu, 2 Jan 2020 10:03:52 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index 6905f484a..bf9d0accc 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -918,4 +918,5 @@ ALTER TABLE `tab_game` ADD COLUMN `pay_config` varchar(255) NOT NULL COMMENT '支付渠道 wx 微信 zfb 支付宝 quick 快捷 (gf 官方 sq 双乾'; ALTER TABLE tab_promote add `company_belong` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会归属:0-内团;1-外团'; -ALTER TABLE tab_promote add `company_relation` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会关系:0-自主开发及维护;1-只维护'; \ No newline at end of file +ALTER TABLE tab_promote add `company_relation` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工会关系:0-自主开发及维护;1-只维护'; + From 10f6caddfacfbd83460147a27faa8835fe8380e0 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 2 Jan 2020 10:49:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=86=85=E5=A4=96=E5=9B=A2=E5=8D=A0=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancePromoteController.class.php | 30 ++++++++++++++++--- .../Admin/View/FinancePromote/index.html | 7 +++++ .../View/FinancePromote/promoteUser.html | 3 ++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 9d4a714f3..25cf7c761 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -105,6 +105,7 @@ class FinancePromoteController extends AdminController ); foreach($senddata as $k=>$v){ + $v['company_belong']?$v['company_belong']='外团':$v['company_belong']='内团'; if(empty($v['company_name'])) $v['company_name']= "万盟天下科技"; if(empty($v['p_id'])) $v['p_id']= "0"; if(!array_key_exists('cash_count',$v)) $v['cash_count']=0; @@ -138,6 +139,24 @@ class FinancePromoteController extends AdminController $this->assign('_page', $page); } + $outBelong = 0; + $insideBelong = 0; + + foreach ($data as $key => $value) { + + if ($value['company_belong']) { + $outBelong+=$value['allcount']; + } else { + $insideBelong+=$value['allcount']; + } + + } + + //外团占比 + $this->assign('outBelong',$outBelong/$count['all_count']*100); + //内团占比 + $this->assign('insideBelong',$insideBelong/$count['all_count']*100); + $size = $row; $data = array_slice($data, ($arraypage - 1) * $size, $size); $this->assign('list_data', $data); @@ -176,7 +195,7 @@ class FinancePromoteController extends AdminController SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count, 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(company_id,0) company_id,company_name,promote.company_belong"; return M() ->table("tab_spend s") ->field($field) @@ -193,7 +212,7 @@ class FinancePromoteController extends AdminController $map['s.source_id']=0; $field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='', s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id, - IFNULL(company_id,0) company_id,company_name"; + IFNULL(company_id,0) company_id,company_name,promote.company_belong"; return M("promote_coin s","tab_") ->field($field) ->where($map) @@ -229,10 +248,12 @@ class FinancePromoteController extends AdminController $senddata = []; //获取各会长的现金充值 $cash = self::promoteUserData([],$istimeselect); + foreach($cash as $k=>$v){ $senddata[$v['promote_id']] = $v; } $inside = self::promoteUserData([],$istimeselect,"promote_coin"); + foreach($inside as $k=>$v){ if(array_key_exists($v['promote_id'],$senddata)){ $senddata[$v['promote_id']]['inside_cash_count']= $v['pay_amount']-$v['back_amount']; @@ -276,6 +297,7 @@ class FinancePromoteController extends AdminController ); foreach($senddata as $k=>$v){ + $v['company_belong']?$v['company_belong']='外团':$v['company_belong']='内团'; if(empty($v['company_name'])) $v['company_name']= "万盟天下科技"; if(empty($v['promote_account'])) $v['promote_account']= "官方渠道"; if(!array_key_exists('cash_count',$v)) $v['cash_count']=0; @@ -339,7 +361,7 @@ class FinancePromoteController extends AdminController $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, 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(company_id,0) company_id,company_name,promote_id,promote.account promote_account,promote.company_belong"; return M() ->table("tab_spend s") ->field($field) @@ -355,7 +377,7 @@ class FinancePromoteController extends AdminController $map['s.status']=1; $map['s.source_id']=0; $field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount, - IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account"; + IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,promote.company_belong"; return M("promote_coin s","tab_") ->field($field) ->where($map) diff --git a/Application/Admin/View/FinancePromote/index.html b/Application/Admin/View/FinancePromote/index.html index e78c19eaa..a707f787f 100644 --- a/Application/Admin/View/FinancePromote/index.html +++ b/Application/Admin/View/FinancePromote/index.html @@ -155,6 +155,7 @@ 推广公司 会长渠道 + 内外团 游戏现金金额▲ @@ -204,6 +205,7 @@ {$data.company_name} {$data['promote_account']} + {$data['company_belong']} {$data.cash_count} @@ -232,6 +234,7 @@ 汇总: + --- {$all_count['cash_count']} {$all_count['balance_coin_count']} {$all_count['bind_coin_count']} @@ -243,6 +246,10 @@ 渠道查看 + + 内外团占比: + 内团充值金额占比:{$insideBelong}%    外团充值金额占比:{$outBelong}% + diff --git a/Application/Admin/View/FinancePromote/promoteUser.html b/Application/Admin/View/FinancePromote/promoteUser.html index faee12887..3e161235b 100644 --- a/Application/Admin/View/FinancePromote/promoteUser.html +++ b/Application/Admin/View/FinancePromote/promoteUser.html @@ -155,6 +155,7 @@ 推广公司 推广员账号 + 内外团 游戏现金金额▲ @@ -203,6 +204,7 @@ {$data.company_name} {$data['promote_account']} + {$data['company_belong']} {$data.cash_count} {$data.balance_coin_count} @@ -219,6 +221,7 @@ 汇总: + --- {$all_count['cash_count']} {$all_count['balance_coin_count']} {$all_count['bind_coin_count']} From 0b3ae062b15c9e195144b0893eeb8f9ff0ac1d30 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Thu, 2 Jan 2020 10:51:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E6=8E=A8?= =?UTF-8?q?=E5=B9=BF=E5=91=98=E6=96=B0=E5=A2=9E=E4=B8=8E=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E6=8E=A8=E5=B9=BF=E5=85=AC=E5=8F=B8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=87=E7=9B=9F=E5=A4=A9=E4=B8=8B=E7=A7=91=E6=8A=80=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9C=80=E6=B1=82=EF=BC=9A=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=91=98=E5=A2=9E=E5=8A=A0=E5=B7=A5=E4=BC=9A=E5=BD=92=E5=B1=9E?= =?UTF-8?q?=E5=92=8C=E5=B7=A5=E4=BC=9A=E5=85=B3=E7=B3=BB=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 62 ++++++++++--- .../Admin/Model/PromoteModel.class.php | 12 +++ Application/Admin/View/Promote/add.html | 43 ++++++++- Application/Admin/View/Promote/edit.html | 88 ++++++++++++++++++- Application/Admin/View/Promote/lists.html | 2 + .../Base/Service/PromoteService.class.php | 2 + 6 files changed, 195 insertions(+), 14 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 9c3ccbb5a..75258aa05 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -141,6 +141,7 @@ class PromoteController extends ThinkController //为数据权限添加 setPowerPromoteIds($map, 'id'); $list_data = D(self::model_name)->where($map)->order('id DESC')->page($p, $row)->select(); + $list_data = D(self::model_name)->parseListData($list_data); $oa_data = []; if (I('oa_associated', -1) == -1) { foreach ($list_data as $k => $v) { @@ -220,14 +221,29 @@ class PromoteController extends ThinkController if ($this->accountExist($account)) { $this->error('该账号已存在'); } - $data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name, - 'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card, - 'admin_id'=>session('user_auth')['uid'],'status'=>$status,'ba_id'=>$ba_id, 'company_id' => $company_id); + $company_belong = $_REQUEST['company_belong']; + $company_relation = $_REQUEST['company_relation']; + $data = array( + 'account'=>$account, + 'password'=>$password, + 'second_pwd'=>$second_pwd, + 'real_name'=>$real_name, + 'email'=>$email, + 'mobile_phone'=>$mobile_phone, + 'bank_name'=>$bank_name, + 'bank_card'=>$bank_card, + 'admin_id'=>session('user_auth')['uid'], + 'status'=>$status, + 'ba_id'=>$ba_id, + 'company_id' => $company_id, + 'company_belong' => $company_belong, + 'company_relation' => $company_relation, + ); if (preg_match('/^[a-zA-Z0-9]{6,15}$/', $account)==false) { $this->error('账号只能是6-15位字母或数字'); } - if (empty($company_id)) { + if ($company_id < 0) { $this->error('请选择推广公司'); } $promoteService = new PromoteService(); @@ -277,12 +293,16 @@ class PromoteController extends ThinkController if (preg_match('/^[a-zA-Z0-9]{6,15}$/', I('post.account'))==false) { $this->error('账号只能是6-15位字母或数字'); } - $promote = M("promote", "tab_")->where(array("id" => $_POST['id']))->field('id, level')->find(); + $promote = M("promote", "tab_") + ->where(array("id" => $_POST['id'])) + ->field('id, level, company_belong, company_relation, company_id') + ->find(); $data['account'] = I('post.account'); if ($this->accountExist($data['account'], $_POST['id'])) { $this->error('该账号已存在'); } - if (empty(I('company_id')) && $promote['level'] ==1) { + $company_id = I('company_id'); + if ($company_id <0 && $promote['level'] ==1) { $this->error('请选择推广公司'); } empty(I('post.id')) ? : $data['id'] =I('post.id'); @@ -310,15 +330,33 @@ class PromoteController extends ThinkController $ba = new \Admin\Model\BusinessAffairsModel(); $ba->update_child($ba_id['ba_id'], $_REQUEST['ba_id'], $id); } - if (!empty(I('company_id')) && $promote['level'] ==1) { - $data['company_id'] = I('company_id'); + + if ($promote['level'] ==1) {//如果是会长才能修改的选项 + if (!is_null($company_id)) { + $data['company_id'] = $company_id;//推广公司 + } + + $data['company_belong'] = I('company_belong');//工会归属 + $data['company_relation'] = I('company_relation');//工会关系 } + $res = M("promote", "tab_")->where(array("id"=>$_POST['id']))->save($data); if ($res !== false) { - if (!empty(I('company_id')) && $promote['level'] ==1) {//修改会长底下推广员的推广公司 - M("promote", "tab_")->where("chain like '%/{$_POST['id']}/%'")->save([ - 'company_id' => I('company_id') - ]); + if ($promote['level'] == 1) {//修改会长底下推广员的推广公司 + $array = array(); + if ($promote['company_id'] != $company_id) { + $array['company_id'] = I('company_id'); + } + if ($promote['company_belong'] != I('company_belong')) { + $array['company_belong'] = I('company_belong'); + } + if ($promote['company_relation'] != I('company_relation')) { + $array['company_relation'] = I('company_relation'); + } + if ($array) { + $res = M("promote", "tab_")->where("chain like '%/{$_POST['id']}/%'")->save($array); + } + } $this->success("修改成功", U('lists')); } else { diff --git a/Application/Admin/Model/PromoteModel.class.php b/Application/Admin/Model/PromoteModel.class.php index b466da9a2..2e9a02bd8 100644 --- a/Application/Admin/Model/PromoteModel.class.php +++ b/Application/Admin/Model/PromoteModel.class.php @@ -407,4 +407,16 @@ class PromoteModel extends Model{ return $result; } + + public function parseListData($result) + { + $parseData = array(); + foreach ($result as $key => $value) { + $parseData[$key] = $value; + $parseData[$key]['company_belong_str'] = $value['company_belong'] ? '外团' : '内团'; + } + return $parseData; + } + + } \ No newline at end of file diff --git a/Application/Admin/View/Promote/add.html b/Application/Admin/View/Promote/add.html index d2a4326dd..ccc01973a 100644 --- a/Application/Admin/View/Promote/add.html +++ b/Application/Admin/View/Promote/add.html @@ -43,7 +43,8 @@ *所属推广公司 内团 + + + + + + + + + 工会关系: + + + + + + + + + 真实姓名: @@ -137,6 +169,15 @@ $(function(){ prov="{:substr($data['bank_area'],0,2)}"; city="{:substr($data['bank_area'],2,2)}"; ciarea="{:substr($data['bank_area'],4,2)}"; + $("input[name=company_belong]").click(function () { + if ($(this).val() == 1) { + $('#company_relation').show(); + } else { + $('#company_relation').hide(); + } + + }); + }); //得到地区码 function getAreaID(){ diff --git a/Application/Admin/View/Promote/edit.html b/Application/Admin/View/Promote/edit.html index f7eb7fc90..6abc2b084 100644 --- a/Application/Admin/View/Promote/edit.html +++ b/Application/Admin/View/Promote/edit.html @@ -183,7 +183,8 @@ + checked="checked" + + name="company_belong" class="company_belong"> 内团 + + + + + + + + id="company_relation"> + 工会关系: + + + + + + + + + + + + 工会归属: + + + + + + + + + + id="company_relation"> + 工会关系: + + + + + + + + + + 注册时间: @@ -353,6 +430,15 @@ $(function(){ city="{:substr($data['bank_area'],2,2)}"; ciarea="{:substr($data['bank_area'],4,2)}"; //initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, prov, city, ciarea); + + $("input[name=company_belong]").click(function () { + if ($(this).val() == 1) { + $('#company_relation').show(); + } else { + $('#company_relation').hide(); + } + + }); }); // //得到地区码 // function getAreaID(){ diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index 0aa7f9d25..c36ecc8df 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -184,6 +184,7 @@ 最后登录时间 渠道类型 所属会长 + 工会归属 商务专员 状态 身份状态 @@ -231,6 +232,7 @@ {:encryptStr(getTopPromote($data['id'])['account'])} + {$data['company_belong_str']} {:get_business_affairs_account($data['ba_id'])} diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 06cf3c2f4..606dfed31 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -940,6 +940,8 @@ class PromoteService { 'company_id' => $params['company_id'] ?? 0, 'invite_code' => $params['invite_code'] ?? '', 'create_time' => time(), + 'company_belong' => $params['company_belong'] ?? 0, + 'company_relation' => $params['company_relation'] ?? 0, ]; if ($parent) { From e39c811da8dc6c2edb3134ef4e6111afa1c58ceb Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 2 Jan 2020 11:23:11 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=88=E7=BB=93?= =?UTF-8?q?=E6=9C=88=E4=BB=BD=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/SpendCountSetController.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index 2ea622e92..16dd8f585 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -18,7 +18,8 @@ class SpendCountSetController extends \Think\Controller //初始化 $this->beginThismonth = mktime(0,0,0,date('m')-1,1,date('Y')); $this->endThismonth = mktime(0,0,0,date('m'),1,date('Y'))-1; - $this->date = date('Y')."-".((date('m')-1) > 9 ? (date('m')-1) : "0".(date('m')-1)); + $temp = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month'))); + $this->date = date('Y',$temp)."-".date('m',$temp); $this->nowdata =time(); $this->model =M(); $this->usermodel =M("spend_user_count",'tab_');