徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
jiuhaoshenghuo/app/controller/store/product/StoreProductReply.php

76 lines
2.1 KiB

<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\controller\store\product;
use app\controller\store\AuthController;
use app\services\product\product\StoreProductReplyServices;
use think\facade\App;
/**
* 评论管理 控制器
* Class StoreProductReply
* @package app\controller\store\product
*/
class StoreProductReply extends AuthController
{
public function __construct(App $app, StoreProductReplyServices $service)
{
parent::__construct($app);
$this->services = $service;
}
/**
* 显示资源列表
*
* @return \think\Response
*/
public function index()
{
$where = $this->request->getMore([
['is_reply', ''],
['store_name', ''],
['account', ''],
['data', ''],
['product_id', 0]
]);
$where['type'] = 1;
$where['relation_id'] = $this->storeId;
$list = $this->services->sysPage($where);
return $this->success($list);
}
/**
* 删除评论
* @param $id
* @return mixed
*/
public function delete($id)
{
$this->services->del($id);
return $this->success('删除成功!');
}
/**
* 回复评论
* @param $id
* @return mixed
*/
public function set_reply($id)
{
[$content] = $this->request->postMore([
['content', '']
], true);
$store_id = $this->storeId;
$this->services->setReply((int)$id, $content, 1, (int)$store_id);
return $this->success('回复成功!');
}
}