|
|
|
@ -19,8 +19,8 @@ class FormTemplate |
|
|
|
*/ |
|
|
|
public static $template_relation = [ |
|
|
|
1 => 'member_campus_activities', |
|
|
|
2 => '', |
|
|
|
3 => '' |
|
|
|
2 => 'rush_activity', |
|
|
|
3 => 'headline_content' |
|
|
|
]; |
|
|
|
|
|
|
|
/** |
|
|
|
@ -45,14 +45,13 @@ class FormTemplate |
|
|
|
|
|
|
|
/** |
|
|
|
* 是否已报名 |
|
|
|
* @param $relation |
|
|
|
* @param $template_type |
|
|
|
* @param $activities_id |
|
|
|
* @return array|false|mixed |
|
|
|
*/ |
|
|
|
public static function isEnroll($relation,$activities_id) |
|
|
|
public static function isEnroll($template_type,$activities_id) |
|
|
|
{ |
|
|
|
$template_type = array_search($relation,self::$template_relation); |
|
|
|
if ($template_type === false) return []; |
|
|
|
#$template_type = self::$template_relation[$template_type]; |
|
|
|
|
|
|
|
$where = [ |
|
|
|
'template_type' => $template_type, |
|
|
|
@ -65,15 +64,32 @@ class FormTemplate |
|
|
|
/** |
|
|
|
* 返回模板信息 |
|
|
|
* @param $id |
|
|
|
* @param $template_type |
|
|
|
* @return array|false|mixed |
|
|
|
*/ |
|
|
|
public static function getDiyFormData($id,$template_type = 1) |
|
|
|
public static function getDiyFormData($id) |
|
|
|
{ |
|
|
|
$res = pdo_get(PDO_NAME . 'diyform',['id' => $id,'template_type' => $template_type]); |
|
|
|
$res = pdo_get(PDO_NAME . 'diyform', ['id' => $id]); |
|
|
|
return $res ?: []; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取所有自定义表单 |
|
|
|
* @param $_W |
|
|
|
* @param $dataWhere |
|
|
|
* @param $order |
|
|
|
* @return array|false|mixed |
|
|
|
*/ |
|
|
|
public static function getAllDiyFormList($_W,$dataWhere = [],$order = 'create_time DESC,id DESC') |
|
|
|
{ |
|
|
|
//自定义表单 |
|
|
|
$formWhere = ['uniacid'=>$_W['uniacid'],'aid'=>$_W['aid']]; |
|
|
|
if(is_store()) $formWhere['sid'] = $_W['storeid']; |
|
|
|
if (!empty($dataWhere['id'])) $formWhere['id'] = $dataWhere['id']; |
|
|
|
|
|
|
|
$diyform = pdo_getall(PDO_NAME."diyform",$formWhere,['id','title'],'',$order); |
|
|
|
|
|
|
|
return $diyform ?: []; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 加密 |
|
|
|
|