|
|
@ -104,7 +104,7 @@ class TestResourceController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
$page = set_pagination($count,$row);
|
|
|
|
$page = set_pagination($count,$row);
|
|
|
|
if($page) {$this->assign('_page', $page);}
|
|
|
|
if($page) {$this->assign('_page', $page);}
|
|
|
|
$this->meta_title = '扶持号管理';
|
|
|
|
$this->meta_title = '资源管理';
|
|
|
|
$this->assign('data',$data);
|
|
|
|
$this->assign('data',$data);
|
|
|
|
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);
|
|
|
|
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);
|
|
|
|
$this->assign('show_data_power', $show_data_power);
|
|
|
|
$this->assign('show_data_power', $show_data_power);
|
|
|
@ -120,34 +120,39 @@ class TestResourceController extends ThinkController
|
|
|
|
$this->error('请选择资源后再进行操作');
|
|
|
|
$this->error('请选择资源后再进行操作');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$resourceData = M('test_resource','tab_')
|
|
|
|
if (!I('status','')&&I('status','')!='0') {
|
|
|
|
->field("promote_id")
|
|
|
|
$this->error('请选择状态后在进行操作');
|
|
|
|
->where(['id'=>['in',$id]])
|
|
|
|
}
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$resourceData = array_column($resourceData,'promote_id');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$promoteId = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($resourceData as $key => $value) {
|
|
|
|
// $resourceData = M('test_resource','tab_')
|
|
|
|
|
|
|
|
// ->field("promote_id")
|
|
|
|
|
|
|
|
// ->where(['id'=>['in',$id]])
|
|
|
|
|
|
|
|
// ->select();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// $resourceData = array_column($resourceData,'promote_id');
|
|
|
|
|
|
|
|
|
|
|
|
$promoteData = M('promote','tab_')
|
|
|
|
// $promoteId = [];
|
|
|
|
->field('id')
|
|
|
|
//
|
|
|
|
->where("chain like '%/{$value}/%' or id = {$value}")
|
|
|
|
// foreach ($resourceData as $key => $value) {
|
|
|
|
->select();
|
|
|
|
//
|
|
|
|
$promoteId = array_merge($promoteData, $promoteId);
|
|
|
|
// $promoteData = M('promote','tab_')
|
|
|
|
}
|
|
|
|
// ->field('id')
|
|
|
|
|
|
|
|
// ->where("chain like '%/{$value}/%' or id = {$value}")
|
|
|
|
|
|
|
|
// ->select();
|
|
|
|
|
|
|
|
// $promoteId = array_merge($promoteData, $promoteId);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
$promoteId = implode(',',array_column($promoteId,'id'));
|
|
|
|
// $promoteId = array_unique($resourceData);
|
|
|
|
|
|
|
|
// var_dump($promoteId);die();
|
|
|
|
|
|
|
|
|
|
|
|
$testResource = M('test_resource','tab_')
|
|
|
|
$testResource = M('test_resource','tab_')
|
|
|
|
->field("user_id")
|
|
|
|
->field("user_id")
|
|
|
|
->where(['promote_id'=>['in',$promoteId]])
|
|
|
|
->where(['id'=>['in',$id]])
|
|
|
|
->group('user_id')
|
|
|
|
->group('user_id')
|
|
|
|
->select();
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
|
|
$data = [
|
|
|
|
$data = [
|
|
|
|
'lock_status' => 0
|
|
|
|
'lock_status' => I('status','')
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
$user_id = implode(',',array_column($testResource,'user_id'));
|
|
|
|
$user_id = implode(',',array_column($testResource,'user_id'));
|
|
|
@ -156,11 +161,11 @@ class TestResourceController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
if ($isFreeze) {
|
|
|
|
if ($isFreeze) {
|
|
|
|
|
|
|
|
|
|
|
|
$this->success('冻结成功',U('index'));
|
|
|
|
$this->success('操作成功',U('supportNumberList'));
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
$this->error('冻结失败',U('index'));
|
|
|
|
$this->error('操作失败',U('supportNumberList'));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|