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.
63 lines
1.6 KiB
63 lines
1.6 KiB
<?php
|
|
|
|
|
|
namespace app\admin\controller\content;
|
|
|
|
|
|
use app\admin\logic\content\HelpCategoryLogic;
|
|
use app\admin\logic\content\HelpLogic;
|
|
use app\admin\logic\content\ResourceCategoryLogic;
|
|
use app\admin\logic\content\ResourceLogic;
|
|
use app\admin\logic\content\ResourceLogLogic;
|
|
use app\admin\validate\content\HelpValidate;
|
|
use app\common\basics\AdminBase;
|
|
use app\common\enum\PayEnum;
|
|
use app\common\model\Client_;
|
|
use app\common\server\JsonServer;
|
|
|
|
class ResourceLog extends AdminBase
|
|
{
|
|
/**
|
|
* @NOTES: 帮助分类列表
|
|
* @author: 张无忌
|
|
*/
|
|
public function lists()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$get = $this->request->get();
|
|
$lists = ResourceLogLogic::lists($get);
|
|
return JsonServer::success("获取成功", $lists);
|
|
}
|
|
|
|
// 订单来源
|
|
$order_source = Client_::getClient(true);
|
|
// 支付方式
|
|
$pay_way = PayEnum::getPayWay(true);
|
|
return view('', [
|
|
'order_source' => $order_source,
|
|
'pay_way' => $pay_way,
|
|
]);
|
|
}
|
|
|
|
|
|
/**
|
|
* @NOTES: 删除帮助分类
|
|
* @author: 张无忌
|
|
*/
|
|
public function del()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
// (new HelpValidate())->goCheck('id');
|
|
$id = $this->request->post('id');
|
|
$res = ResourceLogLogic::del($id);
|
|
if ($res === false) {
|
|
$error = ResourceLogLogic::getError() ?: '删除失败';
|
|
return JsonServer::error($error);
|
|
}
|
|
return JsonServer::success('删除成功');
|
|
}
|
|
|
|
return JsonServer::error('异常');
|
|
}
|
|
|
|
}
|