|
@@ -207,54 +207,19 @@ class oper_smsControl extends SystemControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private function filtrate(member_info $minfo, $instFilters)
|
|
|
- {
|
|
|
- foreach ($instFilters as $filter)
|
|
|
- {
|
|
|
- if($filter->filtrate($minfo) == false) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
public function view_usersOp()
|
|
|
{
|
|
|
- $arr_filters = $this->format_member_filter($_POST);
|
|
|
- if(count($arr_filters))
|
|
|
+ $filter_params = $this->format_member_filter($_POST);
|
|
|
+ if(!empty($filter_params))
|
|
|
{
|
|
|
- $filters_inst = async\filter::create($arr_filters);
|
|
|
- $broadcast_inst = new async\broadcast($filters_inst);
|
|
|
- $match_users_count = $broadcast_inst->count();
|
|
|
- /*$mod_member = Model('member');
|
|
|
- $member_count = $mod_member->count();
|
|
|
- $match_users_count = 0;
|
|
|
- $i = 0;
|
|
|
- while ($i<=round($member_count/1000)) {
|
|
|
- $start = $i * 1000;
|
|
|
- $items = $mod_member->field('*')->order('member_id asc')->limit("{$start},1000")->select();
|
|
|
- if (empty($items)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- $i++;
|
|
|
-
|
|
|
- $match_users = [];
|
|
|
- foreach ($items as $item)
|
|
|
- {
|
|
|
- $minfo = new member_info($item);
|
|
|
- if($this->filtrate($minfo, $filters_inst)) {
|
|
|
- $match_users[] = $minfo;
|
|
|
- }
|
|
|
- }
|
|
|
- $match_users_count += count($match_users);
|
|
|
- }*/
|
|
|
+ $filters = async\filter::create($filter_params);
|
|
|
+ $broadcast = new async\broadcast($filters);
|
|
|
+ $match_users = $broadcast->count();
|
|
|
|
|
|
- if($match_users_count > 0){
|
|
|
- showMessage("有 ". $match_users_count. " 个用户符合筛选条件", '','json','succ');
|
|
|
+ if($match_users > 0){
|
|
|
+ showMessage("有 ". $match_users. " 个用户符合筛选条件", '','json','succ');
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else {
|
|
|
showMessage("没有用户符合筛选条件", '','json','error');
|
|
|
}
|
|
|
}
|
|
@@ -262,6 +227,5 @@ class oper_smsControl extends SystemControl
|
|
|
{
|
|
|
showMessage("请设置筛选条件", '','json','error');
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|