|
|
|
@ -23,6 +23,12 @@ class FormTemplate |
|
|
|
3 => '' |
|
|
|
]; |
|
|
|
|
|
|
|
/** |
|
|
|
* 次类型数据加密存储 |
|
|
|
* @var string[] |
|
|
|
*/ |
|
|
|
public static $template_id_arr = ['datetime','city','img','checkbox']; |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取活动关联id |
|
|
|
* @param $template_type |
|
|
|
@ -37,6 +43,25 @@ class FormTemplate |
|
|
|
return $res ?: []; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 是否已报名 |
|
|
|
* @param $relation |
|
|
|
* @param $activities_id |
|
|
|
* @return array|false|mixed |
|
|
|
*/ |
|
|
|
public static function isEnroll($relation,$activities_id) |
|
|
|
{ |
|
|
|
$template_type = array_search($relation,self::$template_relation); |
|
|
|
if ($template_type === false) return []; |
|
|
|
|
|
|
|
$where = [ |
|
|
|
'template_type' => $template_type, |
|
|
|
'activities_id' => $activities_id |
|
|
|
]; |
|
|
|
$res = pdo_get(PDO_NAME . 'member_enroll',$where); |
|
|
|
return $res ?: []; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 返回模板信息 |
|
|
|
* @param $id |
|
|
|
@ -48,4 +73,24 @@ class FormTemplate |
|
|
|
$res = pdo_get(PDO_NAME . 'diyform',['id' => $id,'template_type' => $template_type]); |
|
|
|
return $res ? : []; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 加密 |
|
|
|
*/ |
|
|
|
public static function serializeTitle(&$value,$title) |
|
|
|
{ |
|
|
|
if (in_array($title,self::$template_id_arr)) { |
|
|
|
$value = serialize($value); |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
* 解密 |
|
|
|
*/ |
|
|
|
public static function unserializeTitle(&$value,$title) |
|
|
|
{ |
|
|
|
if (in_array($title,self::$template_id_arr)) { |
|
|
|
$value = unserialize($value); |
|
|
|
} |
|
|
|
} |
|
|
|
} |