浏览代码

Merge branch 'master' of ssh://git.dever.cc:10022/dever-product/churen

rabin 3 年之前
父节点
当前提交
6cb21f49e6
共有 3 个文件被更改,包括 32 次插入3 次删除
  1. 6 1
      tool/clue/database/salepeople.php
  2. 24 0
      tool/clue/lib/Info.php
  3. 2 2
      tool/work/lib/Appoint.php

+ 6 - 1
tool/clue/database/salepeople.php

@@ -1,4 +1,9 @@
 <?php
+$list_button = array();
+if (Dever::load('manage/auth')->checkFunc('clue.salepeople', 'edit', '回收全部线索')) {
+    $list_button['oper'] = array('回收全部线索','clue/lib/info.back_people?id={id}');
+}
+
 return array
 (
     # 表名
@@ -110,7 +115,7 @@ return array
     	//'insert' => false,
         // 'delete' => false,
         // 'edit' => false,
-        // 'list_button' => array
+        'list_button' => $list_button,
         // (
         //     'list' => array('关联问题列表', '"question&search_option_branch_id={group}&oper_table=info"')
         // ),

+ 24 - 0
tool/clue/lib/Info.php

@@ -363,4 +363,28 @@ Class Info
 			}
 		}
 	}
+	public function back_people_api($id)
+	{
+		Dever::config('base')->hook = true;
+		$data = Dever::db('clue/salepeople')->find($id);
+		$branch = Dever::db('work/branch')->find(array('group_id'=>$data['group_id']));
+		$admin_id = explode(',',$branch['group']);
+		if ($data['group']!=$branch['group']) {
+			$info = Dever::db('clue/info')->state(array('follow'=>$data['group']));
+			if ($info) {
+				foreach ($info as $k =>$v) {
+					$where['where_id'] = $v['id'];
+					$where['follow'] = $branch['group'];
+					$where['follow_group_id'] = $branch['group_id'];
+					$where['follow_admin_id'] = $admin_id[1];
+					Dever::db('clue/info')->update($where);
+					// print_R($v);die;
+					// echo dever::sql();die;
+				}
+			}
+		}
+		return 'ok';
+		// print_R($branch);die;
+		// print_R($data);die;
+	}
 }

+ 2 - 2
tool/work/lib/Appoint.php

@@ -575,13 +575,13 @@ Class Appoint
                     $user['type'][] = '客服系统用户';
                 }
                 if ($option) {
-                    $user['name'] = $member['name'].'<br/>'.$mobile;
+                    $user['name'] = $option['name'].'<br/>'.$mobile;
                     $user['type'][] = '期权账户';
                     $data['user']['option'] = Dever::url('project/database/list?project=option&table=member&search_option_id='.$option['id'], 'manage');
                     $data['user']['option'] = Dever::url('home?link=' . urlencode( $data['user']['option']) . '&group=8&parent_menu=menu_279&menu=menu_279.menu_291' , 'manage');
                 }
                 if ($passport) {
-                    $user['name'] = $member['username'].'<br/>'.$mobile;
+                    $user['name'] = $passport['username'].'<br/>'.$mobile;
                     $user['type'][] = '小程序用户';
                 }
                 if ($member) {