其余文件
This commit is contained in:
113
app/admin/controller/team/Activity.php
Normal file
113
app/admin/controller/team/Activity.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\controller\team;
|
||||
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\admin\logic\team\ActivityLogic;
|
||||
use think\facade\View;
|
||||
|
||||
class Activity extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @Notes: 拼团商品
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = ActivityLogic::lists($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
|
||||
View::assign('statistics', ActivityLogic::statistics());
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 拼团商品的开团记录
|
||||
* @author 张无忌
|
||||
* @date 2021/7/19 11:00
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = ActivityLogic::record($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
|
||||
|
||||
$get = $this->request->get();
|
||||
View::assign('shop_id', $get['shop_id']);
|
||||
View::assign('team_activity_id', $get['id']);
|
||||
View::assign('recordStatistics', ActivityLogic::recordStatistics($get));
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 统计
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function statistics()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$detail = ActivityLogic::statistics();
|
||||
return JsonServer::success('获取成功', $detail);
|
||||
}
|
||||
return JsonServer::error('异常');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 审核
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function audit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$res = ActivityLogic::audit($post);
|
||||
if ($res === false) {
|
||||
$message = ActivityLogic::getError() ?: '审核失败';
|
||||
return JsonServer::error($message);
|
||||
}
|
||||
return JsonServer::success('审核成功');
|
||||
}
|
||||
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 违规重审
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function violation()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post('id');
|
||||
$res = ActivityLogic::violation($id);
|
||||
if ($res === false) {
|
||||
$message = ActivityLogic::getError() ?: '操作失败';
|
||||
return JsonServer::error($message);
|
||||
}
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
|
||||
return JsonServer::error("异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 拼团信息
|
||||
* @Author: 张无忌
|
||||
* @return \think\response\View
|
||||
*/
|
||||
public function details()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
View::assign('detail', ActivityLogic::detail($id));
|
||||
return view();
|
||||
}
|
||||
}
|
||||
72
app/admin/controller/team/Found.php
Normal file
72
app/admin/controller/team/Found.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\controller\team;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\admin\logic\team\FoundLogic;
|
||||
use think\facade\View;
|
||||
|
||||
/**
|
||||
* 拼团记录管理
|
||||
* Class Record
|
||||
* @package app\shop\controller\team
|
||||
*/
|
||||
class Found extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @Notes: 拼团记录
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = FoundLogic::lists($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
|
||||
View::assign('statistics', FoundLogic::statistics());
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 数据统计
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function statistics()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$detail = FoundLogic::statistics();
|
||||
return JsonServer::success('获取成功', $detail);
|
||||
}
|
||||
return JsonServer::error('异常');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Notes: 拼团记录详细
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
View::assign('detail', FoundLogic::detail($id));
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 参团列表
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function join()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$get = $this->request->get();
|
||||
$lists = FoundLogic::join($get);
|
||||
return JsonServer::success('获取成功', $lists);
|
||||
}
|
||||
return JsonServer::error('请求异常');
|
||||
}
|
||||
}
|
||||
39
app/admin/controller/team/Setting.php
Normal file
39
app/admin/controller/team/Setting.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\admin\controller\team;
|
||||
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\server\JsonServer;
|
||||
use think\facade\View;
|
||||
|
||||
class Setting extends AdminBase
|
||||
{
|
||||
/**
|
||||
* @Notes: 拼团设置页
|
||||
* @Author: 张无忌
|
||||
* @return \think\response\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$automatic = ConfigServer::get('team', 'automatic', 0);
|
||||
View::assign('automatic', $automatic);
|
||||
return view();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Notes: 设置拼团
|
||||
* @Author: 张无忌
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$automatic = $this->request->post('automatic', 0, 'intval');
|
||||
ConfigServer::set('team', 'automatic', $automatic);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
return JsonServer::error('异常');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user