后台
This commit is contained in:
31
app/czg/controller/InviteAwardController.php
Normal file
31
app/czg/controller/InviteAwardController.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace app\czg\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\DatabaseRoute;
|
||||
use think\facade\Db;
|
||||
|
||||
class InviteAwardController extends Backend
|
||||
{
|
||||
protected array $noNeedLogin = ['*'];
|
||||
|
||||
|
||||
public function selectInviteAwardList()
|
||||
{
|
||||
$inviteList = Db::name('invite_award')->order('invite_count', 'asc')->select();
|
||||
$this->successWithData(buildPageInfo(convertToCamelCase($inviteList->toArray()), true));
|
||||
}
|
||||
|
||||
public function deleteInviteAward()
|
||||
{
|
||||
$post = $this->request->param();
|
||||
$inviteAwardId = !empty($post['inviteAwardId'])?$post['inviteAwardId']:$this->error('参数不完整');
|
||||
$db = Db::connect(get_master_connect_name());
|
||||
if($db->name('invite_award')->where(['invite_award_id' => $inviteAwardId])->delete()) {
|
||||
$this->success();
|
||||
}
|
||||
$this->error();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user