|
@@ -44,7 +44,7 @@ class Recruitment extends Api{
|
|
// 如果城市限制并且不在在城市范围内,不允许参加
|
|
// 如果城市限制并且不在在城市范围内,不允许参加
|
|
if ( $data['city_ids'] && !in_array($custom['city_id'],explode(',',$data['city_ids'])) ) return json_send(['code'=>'error','msg'=>'账号不在城市范围,请核对您的城市','data'=>['error'=>'不在标签范围内']]);
|
|
if ( $data['city_ids'] && !in_array($custom['city_id'],explode(',',$data['city_ids'])) ) return json_send(['code'=>'error','msg'=>'账号不在城市范围,请核对您的城市','data'=>['error'=>'不在标签范围内']]);
|
|
// 是否需要获取用户标签
|
|
// 是否需要获取用户标签
|
|
- $tags = $data['tag_scope'] || $data['tag_except'] ? $WeiBanTags->getTags($uid) : [];
|
|
|
|
|
|
+ $tags = $data['tag_scope'] || $data['tag_except'] ? $WeiBanTags->getListByWeibanExtid($uid) : [];
|
|
// 获取用户的标签
|
|
// 获取用户的标签
|
|
$tags = $tags ? array_column($tags,'name') : [];
|
|
$tags = $tags ? array_column($tags,'name') : [];
|
|
// 判断是不是可以参与
|
|
// 判断是不是可以参与
|
|
@@ -137,14 +137,15 @@ class Recruitment extends Api{
|
|
if( $data['start_time'] > $custom['insert_time'] || $data['end_time'] < $custom['insert_time'] ) return json_send(['code'=>'error','msg'=>'账号不在活动范围','data'=>['error'=>'不在活动时间内注册']]);
|
|
if( $data['start_time'] > $custom['insert_time'] || $data['end_time'] < $custom['insert_time'] ) return json_send(['code'=>'error','msg'=>'账号不在活动范围','data'=>['error'=>'不在活动时间内注册']]);
|
|
// 如果城市限制并且不在在城市范围内,不允许参加
|
|
// 如果城市限制并且不在在城市范围内,不允许参加
|
|
if ( $data['city_ids'] && !in_array($custom['city_id'],explode(',',$data['city_ids'])) ) return json_send(['code'=>'error','msg'=>'账号不在城市范围,请核对您的城市','data'=>['error'=>'不在标签范围内']]);
|
|
if ( $data['city_ids'] && !in_array($custom['city_id'],explode(',',$data['city_ids'])) ) return json_send(['code'=>'error','msg'=>'账号不在城市范围,请核对您的城市','data'=>['error'=>'不在标签范围内']]);
|
|
|
|
+ // 是否需要获取用户标签
|
|
|
|
+ $tags = $data['tag_scope'] || $data['tag_except'] ? $WeiBanTags->getListByWeibanExtid($uid) : [];
|
|
|
|
+ // 获取用户的标签
|
|
|
|
+ $tags = $tags ? array_column($tags,'name') : [];
|
|
// 判断是不是可以参与
|
|
// 判断是不是可以参与
|
|
if( $data['tag_scope'] ) {
|
|
if( $data['tag_scope'] ) {
|
|
// 解析数组
|
|
// 解析数组
|
|
$data['tag_scope'] = explode(',',$data['tag_scope']);
|
|
$data['tag_scope'] = explode(',',$data['tag_scope']);
|
|
- // 查询用户标签
|
|
|
|
- $tags = $WeiBanTags->getListByWeibanExtid($custom['weiban_extid']);
|
|
|
|
- // 获取用户的标签
|
|
|
|
- $tags = array_column($tags,'name');
|
|
|
|
|
|
+ // 计算交集
|
|
$intersect = count(array_intersect($data['tag_scope'],$tags));
|
|
$intersect = count(array_intersect($data['tag_scope'],$tags));
|
|
// 判断标签是否必须同时满足
|
|
// 判断标签是否必须同时满足
|
|
if( $data['tag_scope_type'] == 1 ) {
|
|
if( $data['tag_scope_type'] == 1 ) {
|