企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
文件路径:shop/controllers/Seller/Service/ConsultCtl.php 一、咨询列表 视图:shop/views/default/Seller/Service/ConsultCtl/index.php 方法:index() ~~~ $data = $this->consultBaseModel->getBaseList($cond_row, array( 'answer_time' => 'desc', 'question_time' => 'desc' ), $page, $rows); ~~~ 二、回复、修改回复咨询 视图:shop/views/default/Seller/Service/ConsultCtl/reply.php 回复提交验证:`$('#form').validator({})` 方法:replyConsult() ~~~ //首先过滤违禁词 if (Text_Filter::checkBanned($consult_answer, $matche_row)) { $data = array(); $msg = __('failure'); $status = 250; $this->data->addBody(-140, array(), $msg, $status); return false; } $flag = $this->consultBaseModel->editBase($consult_id, $data); ~~~ 三、删除咨询 方法:delConsult()、delAllConsult() ~~~ <span class="del"><a data-param="{'ctl':'Seller_Service_Consult','met':'delConsult','id':'<?= $value['consult_id'] ?>'}"href="javascript:void(0)"><i class="iconfont icon-lajitong"></i><?=__('删除')?></a></span> <label class="del" data-param="{'ctl':'Seller_Service_Consult','met':'delAllConsult'}"><i class="iconfont icon-lajitong"></i><?=__('删除')?></label> ~~~ ~~~ //delConsult() $flag = $this->consultBaseModel->removeBase($consult_id); //delAllConsult() $del_flag = $this->consultBaseModel->removeSelectedConsult($v); ~~~ 四、用户购买咨询 * 视图:shop/views/default/Goods/GoodsCtl/goods.php 商品详情->购买咨询 JS:shop/static/default/js/goods_detail.js ~~~ //咨询 load_goodseval(SITE_URL + '?ctl=Goods_Goods&met=getConsultListRows&goods_id=' + goods_id,'goodsadvisory'); ~~~ * 购买咨询视图:shop/views/default/Goods/GoodsCtl/getConsultListRows.php 方法:getConsultListRows(); * 发起咨询提问: 视图:shop/views/default/Buyer/Service/ConsultCtl/add.php 控制器方法:shop/controllers/Buyer/Service/ConsultCtl.php -> addConsult() `$flag = $this->consultBaseModel->addBase($data);`