From 78a7ab4c22a8dfff78067bbee6ce7d5e5bb61b59 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Fri, 3 Nov 2023 16:54:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8A=A5=E5=90=8D=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/weliam_smartcity/api/Goods.php | 2 +- addons/weliam_smartcity/api/Student.php | 2 +- addons/weliam_smartcity/core/class/FormTemplate.class.php | 6 ++++-- addons/weliam_smartcity/plugin/headline/uniapp.php | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/weliam_smartcity/api/Goods.php b/addons/weliam_smartcity/api/Goods.php index 6067b23..8e55f54 100644 --- a/addons/weliam_smartcity/api/Goods.php +++ b/addons/weliam_smartcity/api/Goods.php @@ -533,7 +533,7 @@ class GoodsModuleUniapp extends Uniapp { // 体验报名 $info['is_enroll'] = 0; if (isset($info['diyformid_enroll'])) { - $enrollInfo = FormTemplate::isEnroll(2,$id); + $enrollInfo = FormTemplate::isEnroll(2,$id,$info['diyformid_enroll']); $info['is_enroll'] = $enrollInfo ? $enrollInfo['id'] : 0; } $this->renderSuccess('商品详细信息',$info); diff --git a/addons/weliam_smartcity/api/Student.php b/addons/weliam_smartcity/api/Student.php index 19a35a8..f06eba0 100644 --- a/addons/weliam_smartcity/api/Student.php +++ b/addons/weliam_smartcity/api/Student.php @@ -226,7 +226,7 @@ class StudentModuleUniapp extends Uniapp $data['is_collect'] = $is_collect ? true : false; // 是否收藏 $data['publish_time'] = date("Y-m-d H:i:s",$data['publish_time']); - $enrollInfo = FormTemplate::isEnroll(1,$id); + $enrollInfo = FormTemplate::isEnroll(1,$id,$data['diyformid']); $data['is_enroll'] = $enrollInfo ? $enrollInfo['id'] : 0; unset($data['create_place'],$data['create_user_id']); diff --git a/addons/weliam_smartcity/core/class/FormTemplate.class.php b/addons/weliam_smartcity/core/class/FormTemplate.class.php index 4d269b9..fc7a2e1 100644 --- a/addons/weliam_smartcity/core/class/FormTemplate.class.php +++ b/addons/weliam_smartcity/core/class/FormTemplate.class.php @@ -47,9 +47,10 @@ class FormTemplate * 是否已报名 * @param $template_type * @param $activities_id + * @param $diyformid * @return array|false|mixed */ - public static function isEnroll($template_type,$activities_id) + public static function isEnroll($template_type,$activities_id,$diyformid) { global $_W; #$template_type = self::$template_relation[$template_type]; @@ -57,7 +58,8 @@ class FormTemplate $where = [ 'template_type' => $template_type, 'activities_id' => $activities_id, - 'mid' => $_W['mid'] + 'mid' => $_W['mid'], + 'diyformid' => $diyformid ]; $res = pdo_get(PDO_NAME . 'member_enroll',$where); return $res ?: []; diff --git a/addons/weliam_smartcity/plugin/headline/uniapp.php b/addons/weliam_smartcity/plugin/headline/uniapp.php index dbe02fb..b4d8f25 100644 --- a/addons/weliam_smartcity/plugin/headline/uniapp.php +++ b/addons/weliam_smartcity/plugin/headline/uniapp.php @@ -157,7 +157,7 @@ class HeadlineModuleUniapp extends Uniapp { //内容转码 $info['content'] = htmlspecialchars_decode($info['content']); $info['content'] = str_replace("section","div",$info['content']); - $enrollInfo = FormTemplate::isEnroll(3,$id); + $enrollInfo = FormTemplate::isEnroll(3,$id,$info['diyformid']); $info['is_enroll'] = $enrollInfo ? $enrollInfo['id'] : 0; $this->renderSuccess('头条的详细信息',$info);