admin/addon/message/shop/controller/Remark.php

67 lines
2.4 KiB
PHP

<?php
/**
* SAAS应用系统 --- 十年开发经验汇集巨献!
* ==========================================================
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
* ----------------------------------------------------------
* 官方网址: https://www.zoomtk.com
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
* ==========================================================
*/
namespace addon\message\shop\controller;
use app\shop\controller\BaseShop;
use addon\message\model\Message as messageModel;
class Remark extends BaseShop{
/**
* Common: 进入留言管理
* Author: wu-hui
* Time: 2023/03/06 9:12
* @return array|mixed
* @throws \think\db\exception\DbException
*/
public function index(){
if(request()->isAjax()) return (new messageModel())->getRemarks($this->site_id);
$this->forthMenu();
return $this->fetch('remark/index');
}
/**
* Common: 查看详情&回复内容
* Author: wu-hui
* Time: 2023/03/06 10:09
* @return array|mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function seeInfo(){
// 获取基本信息
$messageCenterId = input('message_center_id');
Model('message_center_read')->update(['is_see'=>1],['message_center_id'=>$messageCenterId]);
if(request()->isAjax()) {
// 回复内容
$replyContent = input('reply_content');
Model('message_center_read')->update(['reply_content'=>$replyContent],['message_center_id'=>$messageCenterId]);
return success();
}
// 获取信息
$where = [
['a.id','=',$messageCenterId]
];
$field = 'a.id,a.created_time,a.message_content,a.image_list,mcr.is_see,m.username,m.nickname,m.headimg';
$info = (new messageModel())->getInfo($where,$field)['data'];
$info['image_list'] = $info['image_list'] ? explode(',',$info['image_list']) : [];
$this->assign('info',$info);
$this->assign('message_center_id',$messageCenterId);
return $this->fetch('remark/see');
}
}