其余文件
This commit is contained in:
82
app/admin/controller/seckill/SeckillGoods.php
Normal file
82
app/admin/controller/seckill/SeckillGoods.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace app\admin\controller\seckill;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use app\admin\logic\seckill\SeckillGoodsLogic;
|
||||
|
||||
class SeckillGoods extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
$statistics = SeckillGoodsLogic::statistics();
|
||||
$seckill_time = SeckillGoodsLogic::getTimeAll();
|
||||
return view('', [
|
||||
'statistics' => $statistics,
|
||||
'seckill_time' => $seckill_time
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function goodsLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$list = SeckillGoodsLogic::goodsList($get);
|
||||
return JsonServer::success('', $list);
|
||||
}
|
||||
}
|
||||
|
||||
public function editGoods(){
|
||||
$id = $this->request->get('id');
|
||||
$seckill_id = $this->request->get('seckill_id');
|
||||
$start_date = $this->request->get('start_date');
|
||||
$end_date = $this->request->get('end_date');
|
||||
|
||||
$detail = SeckillGoodsLogic::getSeckillGoods($id,$seckill_id,$start_date,$end_date);
|
||||
$seckill_time = SeckillGoodsLogic::getTimeAll();
|
||||
|
||||
return view('', [
|
||||
'seckill' => $seckill_time,
|
||||
'detail' => $detail
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 违规重审
|
||||
*/
|
||||
public function reAudit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = SeckillGoodsLogic::reAudit($post);
|
||||
if ($result === true) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return JsonServer::error(SeckillGoodsLogic::getError());
|
||||
}
|
||||
|
||||
$get = $this->request->get();
|
||||
return view('re_audit', [
|
||||
'get' => $get
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*/
|
||||
public function audit()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$result = SeckillGoodsLogic::audit($post);
|
||||
if ($result) {
|
||||
return JsonServer::success('操作成功');
|
||||
}
|
||||
return JsonServer::error(SeckillGoodsLogic::getError());
|
||||
}
|
||||
$get = $this->request->get();
|
||||
return view('audit', [
|
||||
'get' => $get
|
||||
]);
|
||||
}
|
||||
}
|
||||
75
app/admin/controller/seckill/SeckillTime.php
Normal file
75
app/admin/controller/seckill/SeckillTime.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
namespace app\admin\controller\seckill;
|
||||
|
||||
use app\admin\logic\seckill\SeckillTimeLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
use think\exception\ValidateException;
|
||||
use app\admin\validate\seckill\SeckillTimeValidate;
|
||||
|
||||
class SeckillTime extends AdminBase
|
||||
{
|
||||
public function lists()
|
||||
{
|
||||
return view();
|
||||
}
|
||||
|
||||
public function addTime()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
try{
|
||||
validate(SeckillTimeValidate::class)->check($post);
|
||||
}catch(ValidateException $e) {
|
||||
return JsonServer::error($e->getError());
|
||||
}
|
||||
$result = SeckillTimeLogic::addTime($post);
|
||||
if($result === true) {
|
||||
return JsonServer::success('新增成功');
|
||||
}
|
||||
return JsonServer::error(SeckillTimeLogic::getError());
|
||||
}
|
||||
return view();
|
||||
}
|
||||
|
||||
public function timeLists(){
|
||||
if($this->request->isAjax()){
|
||||
$get= $this->request->get();
|
||||
$list = SeckillTimeLogic::timeList($get);
|
||||
return JsonServer::success('', $list);
|
||||
}
|
||||
}
|
||||
|
||||
public function editTime(){
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
try{
|
||||
validate(SeckillTimeValidate::class)->check($post);
|
||||
}catch(ValidateException $e) {
|
||||
return JsonServer::error($e->getError());
|
||||
}
|
||||
$result = SeckillTimeLogic::editTime($post);
|
||||
if($result === true) {
|
||||
return JsonServer::success('编辑成功');
|
||||
}
|
||||
return JsonServer::error(SeckillTimeLogic::getError());
|
||||
}
|
||||
|
||||
$id = $this->request->get('id', '', 'intval');
|
||||
return view('', [
|
||||
'detail' => SeckillTimeLogic::getTime($id)
|
||||
]);
|
||||
}
|
||||
|
||||
public function delTime(){
|
||||
if($this->request->isAjax()){
|
||||
$id = $this->request->post('id');
|
||||
$result = SeckillTimeLogic::delTime($id);
|
||||
|
||||
if($result === true) {
|
||||
return JsonServer::success('删除成功');
|
||||
}
|
||||
return JsonServer::error(SeckillTimeLogic::getError());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user