add
This commit is contained in:
63
app/admin/controller/PayClassify.php
Normal file
63
app/admin/controller/PayClassify.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\DatabaseRoute;
|
||||
use think\facade\Db;
|
||||
|
||||
class PayClassify extends Backend
|
||||
{
|
||||
protected array $noNeedLogin = ['*'];
|
||||
public function selectPayClassifyList()
|
||||
{
|
||||
$infos = Db::name('pay_classify')->select()->toArray();
|
||||
foreach ($infos as $k => &$v) {
|
||||
$v['pay_classify_id'] = (string) $v['pay_classify_id'];
|
||||
}
|
||||
$this->successWithData([
|
||||
'currPage' => 1,
|
||||
'pageSize' => count($infos),
|
||||
'totalCount' => count($infos),
|
||||
'totalPage' => 1,
|
||||
'list' => convertToCamelCase($infos)
|
||||
]);
|
||||
}
|
||||
|
||||
public function updatePayClassify()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
if (empty($params['payClassifyId'])) {
|
||||
$this->error('参数错误');
|
||||
}
|
||||
unset($params['memberId']);
|
||||
Db::name('pay_classify')->where([
|
||||
'pay_classify_id' => $params['payClassifyId']
|
||||
])->update(convertKeysCamelToSnakeRecursive($params));
|
||||
$this->success();
|
||||
}
|
||||
|
||||
public function insertPayClassify()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params['create_time'] = getNormalDate();
|
||||
unset($params['memberId']);
|
||||
unset($params['payClassifyId']);
|
||||
Db::name('pay_classify')->insert(convertKeysCamelToSnakeRecursive($params));
|
||||
$this->success();
|
||||
}
|
||||
|
||||
public function deletePayClassify()
|
||||
{
|
||||
$params = $this->request->get();
|
||||
if (empty($params['payClassifyId'])) {
|
||||
$this->error('参数错误');
|
||||
}
|
||||
Db::name('pay_classify')->delete([
|
||||
'pay_classify_id' => $params['payClassifyId']
|
||||
]);
|
||||
$this->success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user