推广公会列表 适配新内外团规则

master
chenzhi 5 years ago
parent d7662eb305
commit 1761d37b5c

@ -2208,6 +2208,30 @@ function a_array_unique($array){
return $data;
}
}
/**
* 获取公会归属关系
* @author chenzhi 20200219
* $id 不传返回所有关系列表
* 传入ID 返回对应的团体关系
*/
function getCompanyRelation($id = -1)
{
$data = array(
["id"=>0,'name'=>"自主开发及维护"],
["id"=>1,'name'=>"只维护"],
["id"=>2,'name'=>"无"]
);
if($id > -1){
foreach($data as $k=>$v){
if($v['id'] == $id){
return $v['name'];
break;
}
}
}else{
return $data;
}
}
/**
* 操作日志

@ -362,10 +362,13 @@ class PromoteController extends ThinkController
if ($promote['level'] ==1) {//如果是会长才能修改的选项
if (!is_null($company_id)) {
$data['company_id'] = $company_id;//推广公司
if($company_id == 0){
$data['company_belong'] = 0;
}else{
$data['company_belong'] = M("PromoteCompany","tab_")->field("company_belong")->where("id = {$company_id}")->find()['company_belong'];
}
}
$data['company_belong'] = I('company_belong');//工会归属
$data['company_relation'] = I('company_relation');//工会关系
// $data['company_relation'] = I('company_relation');//工会关系
}
$settlementType = intval(I('settlement_type', 1));
if (!empty(I('settlement_type')) && in_array($settlementType, [1, 2])) {
@ -376,6 +379,12 @@ class PromoteController extends ThinkController
if ($promote['level'] == 1) {//修改会长底下推广员的推广公司
$array = array();
if ($promote['company_id'] != $company_id) {
//内外团关系也要跟着公司走
if($company_id == 0){
$array['company_belong'] = 0;
}else{
$array['company_belong'] = M("PromoteCompany","tab_")->field("company_belong")->where("id = {$company_id}")->find()['company_belong'];
}
$array['company_id'] = I('company_id');
}
// if ($promote['company_belong'] != I('company_belong')) {

@ -425,7 +425,7 @@ class PromoteModel extends Model{
foreach ($result as $key => $value) {
$parseData[$key] = $value;
$parseData[$key]['company_belong_str'] = getCompanyBlong($value['company_belong']);
$parseData[$key]['company_relation_str'] = $value['company_relation'] ? '只维护' : '自主开发及维护';
$parseData[$key]['company_relation_str'] = getCompanyRelation($value['company_relation']);
}
return $parseData;
}

@ -93,7 +93,7 @@
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="promote_level">
<select name="promote_level" class="select_gallery">
<option value="">推广员等级</option>
<option value="1">会长</option>
<option value="2">部门长</option>
@ -118,7 +118,7 @@
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="status">
<select name="status" class="select_gallery">
<option value="">渠道状态</option>
<option value="1">正常</option>
<option value="2">{:L('Lock')}</option>
@ -126,7 +126,7 @@
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="ver_status">
<select name="ver_status" class="select_gallery">
<option value="">审核状态</option>
<option value="0">未认证</option>
<option value="1">审核成功</option>
@ -136,7 +136,7 @@
</select>
</div>
<div class="input-list input-list-channelstatus">
<select name="oa_associated">
<select name="oa_associated" class="select_gallery">
<option value="">oa关联</option>
<option value="1">已关联</option>
<option value="0">未关联</option>
@ -202,8 +202,8 @@
<th ><a class="paixu" data-order='last_login_time'>最后登录时间</a></th>
<th>渠道类型</th>
<th>所属会长</th>
<th>会归属</th>
<th>会关系</th>
<th>会归属</th>
<th>会关系</th>
<th>归属管理员</th>
<th>商务专员</th>
<th>状态</th>

Loading…
Cancel
Save