From 275600839d403309c5ba10d2e4764503a2559586 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Tue, 21 Feb 2023 15:19:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=9Asite=5Fid=E5=BC=BA=E5=88=B6=E4=B8=BA1=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=EF=BC=9A=E6=B3=A8=E5=86=8C=E6=89=BF=E8=AF=BA=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/article/api/controller/Index.php | 215 ++++++++++++ addon/article/config/diy_view.php | 46 +++ addon/article/config/event.php | 26 ++ addon/article/config/info.php | 22 ++ addon/article/config/menu_shop.php | 85 +++++ addon/article/data/install.sql | 1 + addon/article/data/uninstall.sql | 1 + addon/article/event/HandleArticleMessage.php | 27 ++ addon/article/event/Install.php | 27 ++ addon/article/event/ShowPromotion.php | 54 +++ addon/article/event/UnInstall.php | 27 ++ addon/article/icon.png | Bin 0 -> 4452 bytes addon/article/model/Article.php | 232 +++++++++++++ addon/article/model/ArticleCategory.php | 119 +++++++ addon/article/model/ArticleFabulous.php | 113 +++++++ addon/article/model/ArticleHistory.php | 112 ++++++ addon/article/model/ArticleShareRecord.php | 57 ++++ .../model/ArticleShareRewardRecord.php | 105 ++++++ addon/article/shop/controller/Cate.php | 46 +++ addon/article/shop/controller/Index.php | 152 +++++++++ addon/article/shop/view/article/edit.html | 286 ++++++++++++++++ addon/article/shop/view/article/index.html | 209 ++++++++++++ addon/article/shop/view/article/select.html | 165 +++++++++ addon/article/shop/view/article/set.html | 92 +++++ addon/article/shop/view/cate/index.html | 318 ++++++++++++++++++ addon/article/shop/view/public/img/live.png | Bin 0 -> 402 bytes .../article/shop/view/public/img/live_new.png | Bin 0 -> 1228 bytes .../shop/view/public/img/live_select.png | Bin 0 -> 1231 bytes addon/member/model/Captcha.php | 2 +- addon/weapp/model/Weapp.php | 2 +- addon/wechat/model/Wechat.php | 2 +- app/Request.php | 11 +- app/shop/controller/BaseShop.php | 2 +- app/shop/controller/Login.php | 2 +- app/shop/controller/Member.php | 1 + app/shop/view/member/reg_config.html | 21 +- 36 files changed, 2567 insertions(+), 13 deletions(-) create mode 100644 addon/article/api/controller/Index.php create mode 100644 addon/article/config/diy_view.php create mode 100644 addon/article/config/event.php create mode 100644 addon/article/config/info.php create mode 100644 addon/article/config/menu_shop.php create mode 100644 addon/article/data/install.sql create mode 100644 addon/article/data/uninstall.sql create mode 100644 addon/article/event/HandleArticleMessage.php create mode 100644 addon/article/event/Install.php create mode 100644 addon/article/event/ShowPromotion.php create mode 100644 addon/article/event/UnInstall.php create mode 100644 addon/article/icon.png create mode 100644 addon/article/model/Article.php create mode 100644 addon/article/model/ArticleCategory.php create mode 100644 addon/article/model/ArticleFabulous.php create mode 100644 addon/article/model/ArticleHistory.php create mode 100644 addon/article/model/ArticleShareRecord.php create mode 100644 addon/article/model/ArticleShareRewardRecord.php create mode 100644 addon/article/shop/controller/Cate.php create mode 100644 addon/article/shop/controller/Index.php create mode 100644 addon/article/shop/view/article/edit.html create mode 100644 addon/article/shop/view/article/index.html create mode 100644 addon/article/shop/view/article/select.html create mode 100644 addon/article/shop/view/article/set.html create mode 100644 addon/article/shop/view/cate/index.html create mode 100644 addon/article/shop/view/public/img/live.png create mode 100644 addon/article/shop/view/public/img/live_new.png create mode 100644 addon/article/shop/view/public/img/live_select.png diff --git a/addon/article/api/controller/Index.php b/addon/article/api/controller/Index.php new file mode 100644 index 00000000..e594e6a1 --- /dev/null +++ b/addon/article/api/controller/Index.php @@ -0,0 +1,215 @@ +apiGetList(); + + return $this->response($list); + } + /** + * Common: 获取设置信息 + * Author: wu-hui + * Time: 2022/10/21 16:03 + * @return false|string + */ + public function setInfo(){ + $info = (new Config())->getConfigInfo('ARTICLE_SETTING'); + + return $this->response($this->success($info)); + } + /** + * Common: 获取文章列表 + * Author: wu-hui + * Time: 2022/10/17 14:25 + * @return false|string + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function articleList(){ + // 缓存名称 + $cacheTag = CaChe::tag($this->params); + $list = CaChe::get('article_list',$cacheTag); + if($list){ + // 存在缓存时的处理 + $list = json_decode($list,TRUE); + }else{ + $list = (new Article())->getList(); + // 记录缓存 + CaChe::set('article_list',json_encode($list,JSON_UNESCAPED_UNICODE),$cacheTag); + } + + return $this->response($list); + } + /** + * Common: 获取详细信息 + * Author: wu-hui + * Time: 2022/10/17 14:35 + * @return false|string + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function details(){ + // 获取用户登录信息 + $checkToken = $this->checkToken(); + if ($checkToken[ 'code' ] < 0) return $this->response($checkToken); + // 参数获取 + $id = input('article_id'); + $sourceMember = input('source_member',0); + // 获取文章信息 + $field = [ + 'article_id', + 'article_title', + 'article_content', + 'article_abstract', + 'cover_img', + 'is_show_release_time', + 'is_show_read_num', + 'is_show_dianzan_num', + "(read_num + initial_read_num) as read_num", + "(dianzan_num + initial_dianzan_num) as dianzan_num", + 'create_time' + ]; + $info = (new Article())->singleInfo($id,$field); + $info['data']['is_fabulous'] = (new ArticleFabulous())->isFabulous($id,$this->member_id); + // 获取用户信息 + $info['member'] = (new Member())->getArticleMemberInfo($this->member_id); + // 文章浏览信息处理 + (new ArticleHistory())->addInfo($this->member_id,$id); + // 记录用户浏览信息 + if($this->member_id != $sourceMember) (new Record())->addInfo($this->member_id,$sourceMember); + + + if(empty($info['data'])) return $this->response($this->error('', '文章不存在')); + return $this->response($info); + } + /** + * Common: 点赞 || 取消点赞 + * Author: wu-hui + * Time: 2022/11/03 15:18 + * @return false|string + */ + public function fabulous(){ + // 获取用户登录信息 + $checkToken = $this->checkToken(); + if ($checkToken[ 'code' ] < 0) return $this->response($checkToken); + // 参数获取 + $id = input('article_id'); + $result = (new ArticleFabulous())->fabulousOperation($id,$this->member_id); + + return $this->response($result); + } + /** + * Common: 获取用户分享、点赞、浏览记录 + * Author: wu-hui + * Time: 2022/11/07 14:33 + * @return false|string + */ + public function getRecordList(){ + // 获取用户登录信息 + $checkToken = $this->checkToken(); + if ($checkToken[ 'code' ] < 0) return $this->response($checkToken); + // 参数获取 + $recordType = input('record_type');// share=分享;fabulous=点赞;browse=浏览 + switch($recordType){ + case 'share':$list = (new ShareRecord())->articleRecord($this->member_id);break; + case 'fabulous':$list = (new ArticleFabulous())->record($this->member_id);break; + case 'browse':$list = (new ArticleHistory())->record($this->member_id);break; + default: $list = $this->error('','记录类型错误!'); + } + + return $this->response($list); + } + /** + * Common: 删除浏览记录、取消点赞 + * Author: wu-hui + * Time: 2022/11/07 15:09 + * @return false|string + */ + public function delRecordInfo(){ + // 获取用户登录信息 + $checkToken = $this->checkToken(); + if ($checkToken[ 'code' ] < 0) return $this->response($checkToken); + // 参数获取 + $recordType = input('record_type');// share=分享;fabulous=点赞;browse=浏览 + $articleId = input('article_id'); + switch($recordType){ + case 'fabulous':$list = (new ArticleFabulous())->fabulousOperation($articleId,$this->member_id);break; + case 'browse':$list = (new ArticleHistory())->delRecord($articleId,$this->member_id);break; + default: $list = $this->error('','记录类型错误!'); + } + + return $this->response($list); + } + /** + * Common: 分享奖励发放 + * Author: wu-hui + * Time: 2022/12/09 15:09 + * @return false|string + */ + public function getShareReward(){ + // 获取用户登录信息 + $checkToken = $this->checkToken(); + if ($checkToken[ 'code' ] < 0) return $this->response($checkToken); + // 参数获取 + $ArticleShareRecordModel = new ArticleShareRecord(); + $ArticleShareRewardRecordModel = new ArticleShareRewardRecord(); + $articleId = input('article_id'); + $shareId = input('share_id'); + $sourceMember = input('source_member'); + $set = (new Config())->getConfigInfo('ARTICLE_SETTING'); + if((float)$set['integral'] > 0){ + // 判断:用户是否通过今日分享信息进入 + [$startTime,$endTime] = getTimeStamp('today'); + $isHas = $ArticleShareRecordModel + ->where('share_time','>=',$startTime) + ->where('share_time','<',$endTime) + ->where('share_id','=',$shareId) + ->value('id'); + // 判断:用户是否已经领取过当前用户的分享奖励 + $isGet = (float)$ArticleShareRewardRecordModel->isReceive($articleId,$this->member_id,$sourceMember); + if($isHas > 0 && !$isGet){ + // 正常领取奖励 + $res = $ArticleShareRewardRecordModel->shareReward($articleId,$this->member_id,$sourceMember,(float)$set['integral']); + if($set['parent_integral'] > 0 && $res['code'] == 0){ + // 上级领取奖励 + $parentMemberId = (new Fenxiao())->getParentMemberId($sourceMember); + $res = $ArticleShareRewardRecordModel->shareReward($articleId,$this->member_id,$parentMemberId,(float)$set['parent_integral'],1); + } + + return $this->response($res); + } + return $this->response($this->error('','不符合领取条件')); + } + + return $this->response($this->error('','未开启文章分享奖励积分')); + } + + + + +} \ No newline at end of file diff --git a/addon/article/config/diy_view.php b/addon/article/config/diy_view.php new file mode 100644 index 00000000..86e225cf --- /dev/null +++ b/addon/article/config/diy_view.php @@ -0,0 +1,46 @@ + [], + 'util' => [ + // [ + // 'name' => 'ArticleInfo', + // 'title' => '文章管理', + // 'type' => 'PROMOTION', + // 'value' => '{}', + // 'sort' => '12007', + // 'support_diy_view' => '', + // 'max_count' => 1, + // 'icon' => 'iconzhibojian' + // ] + ], + 'link' => [ + // [ + // 'name' => 'ARTICLE', + // 'title' => '文章', + // 'parent' => 'MARKETING_LINK', + // 'wap_url' => '', + // 'web_url' => '', + // 'sort' => 0, + // 'child_list' => [ + // [ + // 'name' => 'ARTICLE_LIST', + // 'title' => '文章', + // 'parent' => '', + // 'wap_url' => '/pages_tool/article/info', + // 'web_url' => '', + // 'sort' => 0 + // ] + // ] + // ] + ] +]; \ No newline at end of file diff --git a/addon/article/config/event.php b/addon/article/config/event.php new file mode 100644 index 00000000..d1fd935c --- /dev/null +++ b/addon/article/config/event.php @@ -0,0 +1,26 @@ + [ + + ], + + 'listen' => [ + //展示活动 + 'ShowPromotion' => [ + 'addon\article\event\ShowPromotion', + ], + // 文章发布通知 + 'HandleArticleMessage' => [ + 'addon\article\event\HandleArticleMessage', + ], + + + + + + ], + + 'subscribe' => [ + ], +]; diff --git a/addon/article/config/info.php b/addon/article/config/info.php new file mode 100644 index 00000000..fceaa852 --- /dev/null +++ b/addon/article/config/info.php @@ -0,0 +1,22 @@ + 'article', + 'title' => '文章管理', + 'description' => '文章管理', + 'type' => 'promotion', //插件类型 system :系统插件(自动安装), promotion:扩展营销插件 tool:工具插件 + 'status' => 1, + 'author' => '', + 'version' => '5.0.2', + 'version_no' => '520220819001', + 'content' => '', +]; \ No newline at end of file diff --git a/addon/article/config/menu_shop.php b/addon/article/config/menu_shop.php new file mode 100644 index 00000000..2283a938 --- /dev/null +++ b/addon/article/config/menu_shop.php @@ -0,0 +1,85 @@ + 'ARTICLE_ROOT', + 'title' => '文章管理', + 'url' => 'article://shop/index/index', // 入口方法 + 'picture' => 'addon/article/shop/view/public/img/live_new.png', // 图标 + 'picture_selected' => 'addon/live/shop/view/public/img/live_select.png', // 选中图标 + 'parent' => 'PROMOTION_TOOL', + 'is_show' => 1, + 'sort' => 1, + 'child_list' => [ + [ + 'name' => 'ARTICLE_INDEX', + 'title' => '文章列表', + 'url' => 'article://shop/index/index', + 'is_show' => 1, + 'sort' => 1, + 'child_list' => [ + [ + 'name' => 'ARTICLE_ADD', + 'title' => '添加文章', + 'url' => 'article://shop/index/editArticle', + 'sort' => 1, + 'is_show' => 0 + ], + [ + 'name' => 'ARTICLE_EDIT', + 'title' => '编辑文章', + 'url' => 'article://shop/index/editArticle', + 'sort' => 2, + 'is_show' => 0 + ], + [ + 'name' => 'ARTICLE_DELETE', + 'title' => '删除文章', + 'url' => 'article://shop/index/delete', + 'sort' => 3, + 'is_show' => 0 + ] + ] + ], + [ + 'name' => 'ARTICLE_CATE', + 'title' => '文章分类', + 'url' => 'article://shop/cate/index', + 'is_show' => 1, + 'sort' => 2, + 'child_list' => [ + [ + 'name' => 'ARTICLE_CATE_ADD', + 'title' => '添加文章分类', + 'url' => 'article://shop/cate/editInfo', + 'sort' => 1, + 'is_show' => 0 + ], + [ + 'name' => 'ARTICLE_CATE_EDIT', + 'title' => '编辑文章分类', + 'url' => 'article://shop/cate/editInfo', + 'sort' => 2, + 'is_show' => 0 + ], + [ + 'name' => 'ARTICLE_CATE_DELETE', + 'title' => '删除文章分类', + 'url' => 'article://shop/cate/delete', + 'sort' => 3, + 'is_show' => 0 + ] + ] + ], + [ + 'name' => 'ARTICLE_SET', + 'title' => '基本设置', + 'url' => 'article://shop/index/set', + 'is_show' => 1, + 'sort' => 3, + ], + ] + ] +]; diff --git a/addon/article/data/install.sql b/addon/article/data/install.sql new file mode 100644 index 00000000..22c382dd --- /dev/null +++ b/addon/article/data/install.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; \ No newline at end of file diff --git a/addon/article/data/uninstall.sql b/addon/article/data/uninstall.sql new file mode 100644 index 00000000..0b4cf1b2 --- /dev/null +++ b/addon/article/data/uninstall.sql @@ -0,0 +1 @@ +SET NAMES 'utf8'; diff --git a/addon/article/event/HandleArticleMessage.php b/addon/article/event/HandleArticleMessage.php new file mode 100644 index 00000000..cfcd62a7 --- /dev/null +++ b/addon/article/event/HandleArticleMessage.php @@ -0,0 +1,27 @@ +sendMessage(); + return $param; + } + + +} \ No newline at end of file diff --git a/addon/article/event/Install.php b/addon/article/event/Install.php new file mode 100644 index 00000000..0b517ee0 --- /dev/null +++ b/addon/article/event/Install.php @@ -0,0 +1,27 @@ + [ + + ], + 'shop' => [ + [ + //插件名称 + 'name' => 'article', + //展示分类(根据平台端设置,admin(平台营销),shop:店铺营销,member:会员营销, tool:应用工具) + 'show_type' => 'tool', + //展示主题 + 'title' => '文章管理', + //展示介绍 + 'description' => '文章管理', + //展示图标 + 'icon' => 'addon/article/icon.png', + //跳转链接 + 'url' => 'article://shop/index/index', + ], + + ], + + ]; + return $data; + } +} \ No newline at end of file diff --git a/addon/article/event/UnInstall.php b/addon/article/event/UnInstall.php new file mode 100644 index 00000000..43c89f6d --- /dev/null +++ b/addon/article/event/UnInstall.php @@ -0,0 +1,27 @@ +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'DESC']; + if($sort) $order = ['sort'=>$sort]; + else if($orders == 'new') $order = ['create_time'=>'DESC'];// 最新 + else if($orders == 'recommend') $order = ['sort'=>'DESC','create_time'=>'DESC'];// 推荐 + else if($orders == 'hot') $order = ['read_num'=>'DESC','create_time'=>'DESC'];// 热门 + else if($orders == 'fabulous') $order = ['dianzan_num'=>'ASC','create_time'=>'DESC'];// 点赞 + // 列表获取 + $field = [ + 'article_id', + 'article_title', + 'category_id', + 'status', + 'sort', + 'create_time', + 'update_time', + 'article_abstract', + 'cover_img', + 'is_show_release_time', + 'is_show_read_num', + 'is_show_dianzan_num', + "(read_num + initial_read_num) as read_num", + "(dianzan_num + initial_dianzan_num) as dianzan_num", + ]; + $result = $this + ->field($field) + ->where('site_id',$this->site_id) + ->when($status >= 0,function($query) use ($status){ + $query->where('status','=',$status); + }) + ->when(strlen($searchText) > 0,function($query) use ($searchText){ + $query->where('article_title','like',"%{$searchText}%"); + }) + ->when($ids,function($query) use ($ids){ + $query->where('article_id','in',explode(',',$ids)); + }) + ->when($cateIds,function($query) use ($cateIds){ + $query->where('category_id','in',explode(',',$cateIds)); + }) + ->when($isRand,function($query){ + $query->orderRaw('rand()'); + },function($query) use ($order){ + $query->order($order); + }) + ->paginate(['list_rows' => $pageSize,'page' => $page]); + if($result) { + $result = $result->toArray(); + $categoryIds = array_column($result['data'],'category_id'); + $cateList = (new ArticleCategory())->getListCateList($categoryIds); + foreach($result['data'] as &$item){ + $item['category_name'] = $cateList[$item['category_id']]; + } + } + + $list = [ + 'count' => $result['total'], + 'list' => $result['data'], + 'page_count' => $result['last_page'], + ]; + + return $this->success($list); + } + /** + * Common: 编辑信息 + * Author: wu-hui + * Time: 2022/11/07 16:47 + * @param $info + * @return array + */ + public function editInfo($info){ + // 添加文章的操作 + $this->startTrans(); + try{ + // 判断是添加还是修改 + if((int)$info[$this->pk] > 0) { + self::update($info, [$this->pk => $info[$this->pk]]);// 修改内容 + }else { + $res = self::create($info); + if($info['status'] == 1) $this->messageRecord($info,$res->article_id); + } + + $this->commit(); + //清除缓存 + CaChe::del('article_list'); + return $this->success(); + }catch(\Exception $e){ + $this->rollback(); + return $this->error('',$e->getMessage()); + } + } + /** + * Common: 删除信息 + * Author: wu-hui + * Time: 2022/11/07 16:44 + * @param $id + * @return array + */ + public function delInfo($id){ + //清除缓存 + CaChe::del('article_list'); + //编辑信息 + return parent::delInfo($id); + } + + + + /** + * Common: 添加模板消息通知 + * Author: wu-hui + * Time: 2022/11/10 15:01 + * @param $info + * @param $articleId + * @return int + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function messageRecord($info,$articleId){ + // 获取所有存在openid 的用户 + $list = Db::name('member') + ->field('member_id,nickname,wx_openid') + ->where('site_id','=',$info['site_id']) + ->where('wx_openid','<>','') + ->select(); + $insert = []; + foreach($list as $item){ + $insert[] = [ + 'member_id' => $item['member_id'], + 'nickname' => $item['nickname'], + 'wx_openid' => $item['wx_openid'], + 'article_id' => $articleId, + 'article_title' => $info['article_title'], + 'create_time' => time(), + ]; + } + Db::name('article_message')->insertAll($insert); + // 开启计划任务 + $cronWhere = [ + 'event' => 'HandleArticleMessage', + ]; + $cronId = model('cron')->getValue($cronWhere,'id'); + if($cronId <= 0) (new Cron())->addCron(2, 5, "处理文章通知消息", "HandleArticleMessage", time(),0); + } + /** + * Common: 发送模板消息通知 + * Author: wu-hui + * Time: 2022/11/10 18:46 + * @throws \think\db\exception\DbException + */ + public function sendMessage(){ + Log::write("文章消息通知 - 开始"); + // 基本信息 + $messageTemplate = Model('message_template')->getValue([['keywords','=','ARTICLE_MESSAGE']],'wechat_json'); + $data["site_id"] = (int)request()->siteid(); + $data["message_info"] = Model('message')->getInfo([['keywords','=','ARTICLE_MESSAGE']]); + $data["message_info"]['wechat_json'] = $messageTemplate; + // 获取列表 + $list = Db::name('article_message') + ->order('id','ASC') + ->limit(30) + ->select(); + if($list) $list = $list->toArray(); + + $successIds = []; + foreach($list as $item){ + $data["openid"] = $item['wx_openid']; + $data["template_data"] = [ + 'keyword1' => $item['article_title'], + 'keyword2' => '成功发布', + 'keyword3' => date('Y-m-d H:i:s',$item['create_time']), + ]; + $data["page"] = '#/pages_aijiu/article/detail?article_id='.$item['article_id']; + $res = (new \addon\wechat\model\Message())->sendMessage($data); + ///if($res['code'] === 0) $successIds[] = $item['id']; + $successIds[] = $item['id'];// 由于积累问题 每次通知只会发布一次,无论成功失败 然后删除 + } + Log::debug("文章消息通知 - 删除",$successIds); + if(count($successIds) > 0) Db::name('article_message')->where([['id','in',$successIds]])->delete(); + Log::debug("文章消息通知 - 结束",$successIds); + } + + + +} \ No newline at end of file diff --git a/addon/article/model/ArticleCategory.php b/addon/article/model/ArticleCategory.php new file mode 100644 index 00000000..02dd10ef --- /dev/null +++ b/addon/article/model/ArticleCategory.php @@ -0,0 +1,119 @@ +'DESC']; + if($sort) $order = ['sort'=>$sort]; + // 列表获取 + $model = $this + ->field('category_id,category_name,sort,create_time,update_time') + ->where('site_id',$siteId) + ->where('category_name','LIKE',"%{$categoryName}%") + ->withCount(['relevanceArticle'=>'article_count']) + ->order($order); + if($isPage){ + $result = $model->paginate(['list_rows' => $pageSize,'page' => $page]); + if($result) $result = $result->toArray(); + $list = [ + 'count' => $result['total'], + 'list' => $result['data'], + 'page_count' => $result['last_page'], + ]; + }else{ + $list = $model->select(); + if($list) $list = $list->toArray(); + } + + return $this->success($list); + } + + /** + * Common: 关联文章表 + * Author: wu-hui + * Time: 2022/10/17 11:10 + */ + public function relevanceArticle(){ + return $this->hasMany(Article::class, 'category_id','category_id'); + } + + /** + * Common: 根据id获取分类列表 + * Author: wu-hui + * Time: 2022/11/03 16:50 + * @param $ids + * @return array 返回由分类id为键 分类名称为值的内容 + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function getListCateList($ids){ + $list = (new ArticleCategory()) + ->field('category_id,category_name') + ->whereIn('category_id',$ids) + ->select(); + if($list){ + $list = $list->toArray(); + + return array_column($list,'category_name','category_id'); + } + + return []; + } + /** + * Common: 客户端文章列表获取全部分类 + * Author: wu-hui + * Time: 2022/11/07 15:28 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function apiGetList(){ + // 列表获取 + $list = $this + ->field('category_id,category_name') + ->where('site_id',$this->site_id) + ->order(['sort'=>'desc','create_time'=>'DESC']) + ->select(); + if($list) $list = $list->toArray(); + + + return $this->success($list); + } + + + + + + +} \ No newline at end of file diff --git a/addon/article/model/ArticleFabulous.php b/addon/article/model/ArticleFabulous.php new file mode 100644 index 00000000..81c67295 --- /dev/null +++ b/addon/article/model/ArticleFabulous.php @@ -0,0 +1,113 @@ + 'timestamp:Y-m-d H:i', + ]; + + /** + * Common: 判断当前用户是否对该文章点赞 + * Author: wu-hui + * Time: 2022/11/03 15:11 + * @param $articleId + * @param $memberId + * @return bool + */ + public function isFabulous($articleId,$memberId){ + return (int)$this + ->where('article_id',$articleId) + ->where('member_id',$memberId) + ->value('id'); + } + /** + * Common: 点赞 || 取消点赞 + * Author: wu-hui + * Time: 2022/11/03 15:18 + * @param $id + * @param $memberId + * @return array + */ + public function fabulousOperation($id,$memberId){ + $articleModel = new Article(); + $this->startTrans(); + try{ + $fabulousId = $this->isFabulous($id,$memberId); + if($fabulousId > 0) { + // 已点赞 取消点赞 + $this->where('id',$fabulousId)->delete(); + // 减少点赞数量 + $articleModel->where('article_id', $id)->dec('dianzan_num', 1)->update(); + }else{ + // 未点赞 进行点赞操作 + $data = [ + 'article_id' => $id, + 'member_id' => $memberId, + 'create_time' => time(), + ]; + $this->insert($data); + // 增加点赞数量 + $articleModel->where('article_id', $id)->inc('dianzan_num', 1)->update(); + } + + $this->commit(); + return $this->success(); + }catch(Exception $e){ + $this->rollback(); + return $this->error('',$e->getMessage()); + } + } + /** + * Common: 获取用户点赞记录 + * Author: wu-hui + * Time: 2022/11/07 14:29 + * @param $memberId + * @return array + */ + public function record($memberId){ + // 参数获取 + $page = input('page',1); + $pageSize = input('page_size',PAGE_LIST_ROWS); + $searchText = (string)trim(input('search_text')); + // 列表获取 + $result = $this->alias('af') + ->field('a.article_id,a.article_title,a.cover_img,af.create_time as time') + ->join('article a','a.article_id = af.article_id','LEFT') + ->where('a.status',1) + ->where('a.site_id',$this->site_id) + ->where('af.member_id',$memberId) + ->when(strlen($searchText) > 0,function($query) use ($searchText){ + $query->where('a.article_title','like',"%{$searchText}%"); + }) + ->order('af.create_time','DESC') + ->paginate(['list_rows' => $pageSize,'page' => $page]); + if($result) $result = $result->toArray(); + $list = [ + 'count' => $result['total'], + 'list' => $result['data'], + 'page_count' => $result['last_page'], + ]; + + return $this->success($list); + } + + +} \ No newline at end of file diff --git a/addon/article/model/ArticleHistory.php b/addon/article/model/ArticleHistory.php new file mode 100644 index 00000000..7304f3c0 --- /dev/null +++ b/addon/article/model/ArticleHistory.php @@ -0,0 +1,112 @@ + 'timestamp:Y-m-d H:i', + ]; + + /** + * Common: 文章浏览历史变更 + * Author: wu-hui + * Time: 2022/11/04 14:10 + * @param $memberId + * @param $id + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function addInfo($memberId,$id){ + // 阅读数量添加 + (new Article())->where('article_id', $id)->inc('read_num', 1)->update(); + // 记录浏览历史 + $info = $this + ->where('article_id',$id) + ->where('member_id',$memberId) + ->find(); + if(!$info) $info = new self(); + $info->article_id = $id; + $info->member_id = $memberId; + $info->frequency += 1; + $info->article_id = $id; + $info->save(); + } + /** + * Common: 获取用户浏览记录 + * Author: wu-hui + * Time: 2022/11/07 14:32 + * @param $memberId + * @return array + */ + public function record($memberId){ + // 参数获取 + $page = input('page',1); + $pageSize = input('page_size',PAGE_LIST_ROWS); + $searchText = (string)trim(input('search_text')); + // 列表获取 + $result = $this->alias('ah') + ->field('a.article_id,a.article_title,a.cover_img,ah.create_time as time') + ->join('article a','a.article_id = ah.article_id','LEFT') + ->where('a.status',1) + ->where('a.site_id',$this->site_id) + ->where('ah.member_id',$memberId) + ->when(strlen($searchText) > 0,function($query) use ($searchText){ + $query->where('a.article_title','like',"%{$searchText}%"); + }) + ->order('ah.create_time','DESC') + ->paginate(['list_rows' => $pageSize,'page' => $page]); + if($result) $result = $result->toArray(); + $list = [ + 'count' => $result['total'], + 'list' => $result['data'], + 'page_count' => $result['last_page'], + ]; + + return $this->success($list); + } + /** + * Common: 删除浏览记录 + * Author: wu-hui + * Time: 2022/11/07 14:54 + * @param $articleId + * @param $memberId + * @return array + */ + public function delRecord($articleId,$memberId){ + $res = $this->where('article_id',$articleId) + ->where('member_id',$memberId) + ->delete(); + + return $this->success($res); + } + + /** + * Common: 关联文章表 + * Author: wu-hui + * Time: 2022/11/08 20:06 + * @return \think\model\relation\HasOne + */ + public function article(){ + return $this->hasOne(Article::class,'article_id','article_id'); + } + +} \ No newline at end of file diff --git a/addon/article/model/ArticleShareRecord.php b/addon/article/model/ArticleShareRecord.php new file mode 100644 index 00000000..277af089 --- /dev/null +++ b/addon/article/model/ArticleShareRecord.php @@ -0,0 +1,57 @@ + $this->site_id, + 'article_id' => $params['article_id'], + 'member_id' => $params['member_id'], + 'share_time' => time(), + 'share_id' => $params['share_id'], + ]; + + return $this->insertGetId($data); + } + /** + * Common: 根据条件 获取统计信息 + * Author: wu-hui + * Time: 2022/11/08 20:43 + * @param $memberId + * @param array $where + * @return int + * @throws \think\db\exception\DbException + */ + public function getCount($memberId,$where = []){ + return $this + ->where(['member_id'=>$memberId]) + ->where($where) + ->count(); + } + + +} \ No newline at end of file diff --git a/addon/article/model/ArticleShareRewardRecord.php b/addon/article/model/ArticleShareRewardRecord.php new file mode 100644 index 00000000..5f6c7ad0 --- /dev/null +++ b/addon/article/model/ArticleShareRewardRecord.php @@ -0,0 +1,105 @@ +where('article_id',$articleId) + ->where('member_id',$memberId) + ->where('hierarchy',0) + ->where('reward_member_id',$sourceMember) + ->value('id'); + + return $id > 0; + } + /** + * Common: 领取分享奖励 + * Author: wu-hui + * Time: 2022/12/09 15:09 + * @param $articleId + * @param $member_id + * @param $sourceMember + * @param $integral + * @param int $hierarchy + * @return array + */ + public function shareReward($articleId,$member_id,$sourceMember,$integral,$hierarchy = 0){ + $this->startTrans(); + try{ + if($member_id == $sourceMember) return $this->error('','领取失败,同一个用户!'); + // 判断:今天是否进行达标 + $set = (new Config())->getConfigInfo('ARTICLE_SETTING'); + $maxIntegral = (float)$set['max_integral']; + if($maxIntegral > 0){ + // 今天已经获取的数量 + [$startTime,$endTime] = getTimeStamp('today'); + $toDayIntegral = (float)$this + ->where('reward_member_id',$sourceMember) + ->where('create_time','>=',$startTime) + ->where('create_time','<',$endTime) + ->sum('integral'); + if($toDayIntegral >= $maxIntegral) { + return $this->error('','超出领取限制'); + } + else { + $surplus = (float)($maxIntegral - $toDayIntegral);// 今日剩余可以获取的奖励积分 + $integral = $surplus >= $integral ? $integral : $surplus; + } + } + // 添加奖励记录 + $data = [ + 'site_id' => $this->site_id, + 'article_id' => $articleId, + 'member_id' => $member_id, + 'hierarchy' => $hierarchy, + 'reward_member_id' => $sourceMember, + 'create_time' => time(), + 'integral' => $integral, + ]; + $this->insert($data); + // 奖励发放 + $remark = '文章分享奖励'; + (new MemberAccountModel())->addMemberAccount($this->site_id, $sourceMember, 'point', $integral, 'share_article', 0, $remark); + + $this->commit(); + return $this->success(); + }catch(\Exception $e){ + $this->rollback(); + return $this->error('',$e->getMessage()); + } + } + + + + + +} \ No newline at end of file diff --git a/addon/article/shop/controller/Cate.php b/addon/article/shop/controller/Cate.php new file mode 100644 index 00000000..fd4f841a --- /dev/null +++ b/addon/article/shop/controller/Cate.php @@ -0,0 +1,46 @@ +forthMenu(); + // 实例化默认模型 + $this->thisDefaultModel = new ArticleCategory(); + + } + + /** + * Common: 分类列表 + * Author: wu-hui + * Time: 2022/10/14 15:29 + * @return array|mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function index(){ + if(request()->isAjax()) return parent::index(); + + return $this->fetch('cate/index'); + } + + +} \ No newline at end of file diff --git a/addon/article/shop/controller/Index.php b/addon/article/shop/controller/Index.php new file mode 100644 index 00000000..90115103 --- /dev/null +++ b/addon/article/shop/controller/Index.php @@ -0,0 +1,152 @@ +forthMenu(); + // 实例化默认模型 + $this->thisDefaultModel = new Article(); + + } + /** + * Common: 文章列表 + * Author: wu-hui + * Time: 2022/10/18 15:28 + * @return array|mixed + * @throws \think\db\exception\DbException + */ + public function index(){ + if (request()->isAjax()) { + $params = input(''); + // 缓存名称 + $cacheTag = CaChe::tag($params); + $list = CaChe::get('article_list',$cacheTag); + if($list){ + // 存在缓存时的处理 + $list = json_decode($list,TRUE); + }else{ + $list = $this->thisDefaultModel->getList(); + // 记录缓存 + CaChe::set('article_list',json_encode($list,JSON_UNESCAPED_UNICODE),$cacheTag); + } + + return $list; + } + + return $this->fetch('article/index'); + } + /** + * Common: 添加编辑文章信息 + * Author: wu-hui + * Time: 2022/10/14 15:44 + * @return array|mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function editInfo(){ + if(request()->isAjax()) return parent::editInfo(); + + parent::editInfo(); + // 获取分类 + $field = ['category_id', 'category_name']; + $categoryList = (new ArticleCategory()) + ->field($field) + ->where('site_id',$this->site_id) + ->order('create_time','DESC') + ->select(); + if($categoryList) $categoryList = $categoryList->toArray(); + $this->assign('category_list',$categoryList ?? []); + + return $this->fetch('article/edit'); + } + /** + * Common: 装修 —— 文章选择器 + * Author: wu-hui + * Time: 2022/10/17 15:18 + * @return array|mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function selectInfo(){ + if (request()->isAjax()) { + // 获取已选择列表 + return parent::index(); + } + else { + //已经选择的商品sku数据 + $ids = (string)trim(input('ids')); + $this->assign('ids', $ids); + // 获取已选择列表 + if(strlen($ids) > 0){ + $result = parent::index();; + $this->assign('article_list', $result['data']['list']); + }else{ + $this->assign('article_list', []); + } + + return $this->fetch("article/select"); + } + } + /** + * Common: 文章基本设置 + * Author: wu-hui + * Time: 2022/10/21 14:18 + * @return array|mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function set(){ + $key = 'ARTICLE_SETTING'; + $configModel = new Config(); + if (request()->isAjax()) { + // 参数获取 + $info = input('info',[]); + $params = [ + 'site_id' => $this->site_id, + 'app_module' => 'shop', + 'config_key' => $key, + 'value' => json_encode($info,JSON_UNESCAPED_UNICODE), + 'config_desc' => '文章基本设置', + 'is_use' => 1, + ]; + + return $configModel->setConfigInfo($params); + } + else { + $info = $configModel->getConfigInfo($key); + $this->assign('info',$info); + + return $this->fetch('article/set'); + } + } + + + +} \ No newline at end of file diff --git a/addon/article/shop/view/article/edit.html b/addon/article/shop/view/article/edit.html new file mode 100644 index 00000000..883e6202 --- /dev/null +++ b/addon/article/shop/view/article/edit.html @@ -0,0 +1,286 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} +{block name="main"} + +
+
+ +
+ +
+
+
+ +
+ +
+
文章摘要最多可输入100个字
+
+ +
+ +
+
+
+
+ +

点击上传

+
+
+ + x +
+
+
推荐使用 750x420 像素的图片
+
+
+ +
+ +
+
+
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ {if $info.status == 1} + + {else /} + + + {/if} + +
+ +
+ +{/block} +{block name="script"} + + + + +{/block} \ No newline at end of file diff --git a/addon/article/shop/view/article/index.html b/addon/article/shop/view/article/index.html new file mode 100644 index 00000000..6154057c --- /dev/null +++ b/addon/article/shop/view/article/index.html @@ -0,0 +1,209 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} + +{block name="main"} + +
+ + +
+
+ +
+
+ + +
+
+
+ +
+ + + +{/block} + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/addon/article/shop/view/article/select.html b/addon/article/shop/view/article/select.html new file mode 100644 index 00000000..e17f0c35 --- /dev/null +++ b/addon/article/shop/view/article/select.html @@ -0,0 +1,165 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} +{block name="body"} +
+
+
+
+ + +
+
+
+
+
+{/block} +{block name="script"} + + +{/block} \ No newline at end of file diff --git a/addon/article/shop/view/article/set.html b/addon/article/shop/view/article/set.html new file mode 100644 index 00000000..62aeb18f --- /dev/null +++ b/addon/article/shop/view/article/set.html @@ -0,0 +1,92 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} + +{block name="main"} +
+ +
+ +
+ {include file='app/shop/view/template/batch_image.html'} +
+
+ +
+ 文字设置 +
+
+ +
+ +
+
+ +
+ 积分设置 +
+
+ +
+ +
分享文章给其他用户,其他用户点击后会获得积分奖励。
+
+
+
+ +
+ +
用户获得分享奖励积分时,上级获得的积分奖励。
+
+
+
+ +
+ +
每日获取的积分奖励上限,包括分享奖励和上级奖励。
+
+
+ +
+ +
+
+{/block} + +{block name="script"} + + +{/block} \ No newline at end of file diff --git a/addon/article/shop/view/cate/index.html b/addon/article/shop/view/cate/index.html new file mode 100644 index 00000000..02738b97 --- /dev/null +++ b/addon/article/shop/view/cate/index.html @@ -0,0 +1,318 @@ +{extend name="app/shop/view/base.html"/} + +{block name="resources"} +{/block} + +{block name="main"} + +
+ +
+
+ + +
+
+
+ +
+ + + + + + + + +{/block} + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/addon/article/shop/view/public/img/live.png b/addon/article/shop/view/public/img/live.png new file mode 100644 index 0000000000000000000000000000000000000000..95c93fd2f4ee6575b382549a1b91be563601edb1 GIT binary patch literal 402 zcmV;D0d4+?P)9p`qCuo&t5G)SK zelo$xd0hS=*=lEI_cz~s45V<3G0!4mz4xPHUhl@3t0;;d(lqUqYZ{}NwAOYtPSdne zYOoLBmgHttlL^RLyBAh}lr0XP?tgyhTQ6OcRS?*F{8)@CHvs^ree)kto8 z@1K4J#Bn?jk&bijW?5Jq$5hqc`{Bw!#+bT@j8LV>7*i9G-8|3R{eJ(Wtn^1w13*)2 zB$HX7CIId9NwV#|zbL{Kq$)_B0yrc&oCi`vFSRSlHw!HUe<%@3tH(y7B~A^L=G0IsHkr_=iaCJZym)PGW-pd82|tP07*qoM6N<$g4#x{9RL6T literal 0 HcmV?d00001 diff --git a/addon/article/shop/view/public/img/live_new.png b/addon/article/shop/view/public/img/live_new.png new file mode 100644 index 0000000000000000000000000000000000000000..6c71a87db7877212d630225d92f5006d4407d490 GIT binary patch literal 1228 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9Q!3HFy+4N(8lw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6H#24=O)kcg59UmvUF{9L_6kQ%*;+ybC(1_m4Zih{)C?9>v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`Gt*5rG%-~$x70H< zGd8ib)KM@pFtpG&u+TR&)-^Px^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal z@=Hr>m4GgVcp)$dWBS4%0rUUtjx6GV>Vky=ju(&m z3d||la%o}H?83s5kE}JWb6FNDe3Y(GI&SLeEB`}f`jbzm3;lJ@f1dK#!YhkK^hx3R zL#u_&XB^vEf4DSus*zf3qG)J}vy)Xp<6Q+6jcDohitW)~9tpO)UFew;UCa{_)`?sdSG(!wbPYF_ zt*7d)mY%)SZ!MGTZZ)%imW=q7HszPkCT!W;vvP@J{EKNH&8ICv4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`Gt*5rG%-~$x70H< zGd8ib)KM@pFtpG&u+TR&)-^Px^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal z@=Hr>m4GgVcpxl&c-mkF8Rr&xv6<2Fuf@Vy{0(zf|5gS0nlcb)S}F?)D*X({9FaFx2-a9 zyTu5nc~HG6xZPrmQ?EYIG5Vm$MT%^g5HJOSnDC?vrZT2I11y%F#bk(Oyb5txn1jYTlEDKYL z7ux9C7P_^Y-_G{QxWp<}&@`=MLe-qa#WIUN&H1PlRoH8GC)r%YWLdIk*@qrUk+pKV z>$~+ou3VaaQHD$F0qfiqj^g(!wlvNc{hEE#b@IMY)%rTVba7Dtd)pP! x-^b6Ms6YK>;c?zshq&eiv6&`WTKp7BV2D`mw64ENP!3eYc)I$ztaD0e0sx)7wrBtV literal 0 HcmV?d00001 diff --git a/addon/member/model/Captcha.php b/addon/member/model/Captcha.php index f7c78bfe..4f28a6a6 100644 --- a/addon/member/model/Captcha.php +++ b/addon/member/model/Captcha.php @@ -9,7 +9,7 @@ class Captcha extends BaseModel public function __construct() { //获取参数 - $this->site_id = request()->siteid(input('site_id',0)); + $this->site_id = request()->siteid(input('site_id',1)); $this->params = input(); $this->params[ 'site_id' ] = $this->site_id; } diff --git a/addon/weapp/model/Weapp.php b/addon/weapp/model/Weapp.php index d9d39057..7386301d 100644 --- a/addon/weapp/model/Weapp.php +++ b/addon/weapp/model/Weapp.php @@ -48,7 +48,7 @@ class Weapp extends BaseModel // 站点ID private $site_id; - public function __construct($site_id = 0) + public function __construct($site_id = 1) { $this->site_id = $site_id; //微信小程序配置 diff --git a/addon/wechat/model/Wechat.php b/addon/wechat/model/Wechat.php index 182d217f..5b613c0d 100644 --- a/addon/wechat/model/Wechat.php +++ b/addon/wechat/model/Wechat.php @@ -55,7 +55,7 @@ class Wechat extends BaseModel 'open_shake' => "是否开通微信摇一摇功能", ); - public function __construct($site_id = 0) + public function __construct($site_id = 1) { $this->site_id = $site_id; // $response = $this->app->server->serve(); diff --git a/app/Request.php b/app/Request.php index 990889d9..cd7f3e5e 100644 --- a/app/Request.php +++ b/app/Request.php @@ -33,11 +33,12 @@ class Request extends \think\Request */ public function siteid($siteid = '') { - if(!empty($siteid)){ - $this->site_id=$siteid; - }else if($siteid=='' && $this->site_id==''){ - $this->site_id=input('site_id',1); - } + // if(!empty($siteid)){ + // $this->site_id=$siteid; + // }else if($siteid=='' && $this->site_id==''){ + // $this->site_id=input('site_id',1); + // } + $this->site_id = 1; return $this->site_id; } diff --git a/app/shop/controller/BaseShop.php b/app/shop/controller/BaseShop.php index f68c98d3..a4d07a6d 100644 --- a/app/shop/controller/BaseShop.php +++ b/app/shop/controller/BaseShop.php @@ -176,7 +176,7 @@ class BaseShop extends Controller */ public function initConstructInfo() { - $this->site_id = input('site_id', 0); + $this->site_id = input('site_id', 1); $config_model = new ConfigModel(); $base = $config_model->getStyle($this->site_id); $this->assign('base', $base); diff --git a/app/shop/controller/Login.php b/app/shop/controller/Login.php index c160f63a..a46593ad 100644 --- a/app/shop/controller/Login.php +++ b/app/shop/controller/Login.php @@ -38,7 +38,7 @@ class Login extends Controller //检测基础登录 $this->site_id = request()->siteid(); if (empty($this->site_id)) { - $this->site_id = input("site_id", 0); + $this->site_id = input("site_id", 1); request()->siteid($this->site_id); } $this->assign('app_module', $this->app_module); diff --git a/app/shop/controller/Member.php b/app/shop/controller/Member.php index 1b441f05..559043d1 100644 --- a/app/shop/controller/Member.php +++ b/app/shop/controller/Member.php @@ -555,6 +555,7 @@ class Member extends BaseShop 'third_party' => input('third_party', 0), 'bind_mobile' => input('bind_mobile', 0), 'alipay_bind_mobile' => input('alipay_bind_mobile', 0), + 'promise' => input('promise', ''), ); return $config_model->setRegisterConfig($data, $this->site_id, 'shop'); } else { diff --git a/app/shop/view/member/reg_config.html b/app/shop/view/member/reg_config.html index 06e88e06..47d1644c 100644 --- a/app/shop/view/member/reg_config.html +++ b/app/shop/view/member/reg_config.html @@ -49,7 +49,6 @@ -
@@ -90,7 +89,6 @@
-
@@ -119,7 +117,24 @@
- +
+
+
+ 承诺书 +
+
+
+
+ 用户注册时必须输入该承诺书才能进行注册。 +
+
+ +
+ +
+
+
+