新增功能
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace app\adminapi\controller;
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\FanLists;
|
||||
use app\adminapi\logic\FanLogic;
|
||||
use app\adminapi\validate\FanValidate;
|
||||
use app\adminapi\validate\FanVisitRecordValidate;
|
||||
|
||||
class FanController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* @notes 粉丝列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new FanLists());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加粉丝
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new FanValidate())->post()->goCheck('add');
|
||||
$params['creator_id'] = $this->adminId;
|
||||
$params['creator_name'] = $this->adminInfo['name'] ?? '';
|
||||
$result = FanLogic::add($params);
|
||||
if ($result) {
|
||||
return $this->success('添加成功', ['id' => $result], 1, 1);
|
||||
}
|
||||
return $this->fail(FanLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑粉丝
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new FanValidate())->post()->goCheck('edit');
|
||||
$result = FanLogic::edit($params);
|
||||
if ($result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FanLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除粉丝
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new FanValidate())->post()->goCheck('id');
|
||||
$result = FanLogic::delete($params);
|
||||
if ($result) {
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FanLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 粉丝详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new FanValidate())->goCheck('id');
|
||||
$result = FanLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 回访记录列表
|
||||
*/
|
||||
public function visitRecordLists()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = FanLogic::visitRecordLists($params);
|
||||
return $this->success('', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 添加回访记录
|
||||
*/
|
||||
public function addVisitRecord()
|
||||
{
|
||||
$params = (new FanVisitRecordValidate())->post()->goCheck('add');
|
||||
$params['operator_id'] = $this->adminId;
|
||||
$params['operator_name'] = $this->adminInfo['name'] ?? '';
|
||||
$result = FanLogic::addVisitRecord($params);
|
||||
if ($result) {
|
||||
return $this->success('添加成功', ['id' => $result], 1, 1);
|
||||
}
|
||||
return $this->fail(FanLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 编辑回访记录
|
||||
*/
|
||||
public function editVisitRecord()
|
||||
{
|
||||
$params = (new FanVisitRecordValidate())->post()->goCheck('edit');
|
||||
$result = FanLogic::editVisitRecord($params);
|
||||
if ($result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FanLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除回访记录
|
||||
*/
|
||||
public function deleteVisitRecord()
|
||||
{
|
||||
$params = (new FanVisitRecordValidate())->post()->goCheck('id');
|
||||
$result = FanLogic::deleteVisitRecord($params);
|
||||
if ($result) {
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FanLogic::getError());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user