|
@@ -199,18 +199,24 @@ class TemplateController extends Controller
|
199
|
199
|
$id = $request->input('id');
|
200
|
200
|
#销售筛选
|
201
|
201
|
//$saler_ids = DB::table('admin_role')->where('role_name', '销售')->lists('user_id');
|
202
|
|
- $adminList = Admin::select('id', 'realname', 'username')->where('id','>', 1)->where(function ($query) {
|
|
202
|
+ $adminList = Admin::select('id', 'realname', 'username', 'team_id')->where('id','>', 1)->where(function ($query) {
|
203
|
203
|
$query->whereNotNull('qrcode')->where('qrcode', '<>', '');
|
204
|
204
|
})->get();
|
205
|
205
|
$adminList = json_decode(json_encode($adminList), true);
|
206
|
206
|
$assign_admin = TemplatesSalers::where('t_id', $id)->where('is_del', 0)->lists('weight', 'admin_id');
|
207
|
207
|
|
|
208
|
+ $team_info = DB::table('teams')->lists('name', 'id');
|
208
|
209
|
foreach($adminList as &$admin){
|
209
|
210
|
if( isset($assign_admin[$admin['id']]) ){
|
210
|
211
|
$admin['weight'] = $assign_admin[$admin['id']];
|
211
|
212
|
}else{
|
212
|
213
|
$admin['weight'] = '';
|
213
|
214
|
}
|
|
215
|
+ if(isset($team_info[$admin['team_id']])){
|
|
216
|
+ $admin['team_name'] = $team_info[$admin['team_id']];
|
|
217
|
+ }else{
|
|
218
|
+ $admin['team_name'] = '';
|
|
219
|
+ }
|
214
|
220
|
}
|
215
|
221
|
return view('template/assign', [
|
216
|
222
|
'adminlist' =>$adminList,
|