add
This commit is contained in:
56
app/admin/controller/TaskCenter.php
Normal file
56
app/admin/controller/TaskCenter.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\DatabaseRoute;
|
||||
use think\facade\Db;
|
||||
|
||||
class TaskCenter extends Backend
|
||||
{
|
||||
protected array $noNeedLogin = ['*'];
|
||||
protected array $noNeedPermission = ['statisticsIncomeMoney', 'statisticsCashMoney'];
|
||||
|
||||
public function selectTaskCenter()
|
||||
{
|
||||
$params = $this->request->param();
|
||||
$this->successWithData(DatabaseRoute::paginateDb('task_center', function ($query) use ($params) {
|
||||
return $query->order('sort');
|
||||
}, $params['page'], $params['limit'], null, true));
|
||||
}
|
||||
|
||||
public function updateTaskCenter()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params = convertKeysCamelToSnakeRecursive($params);
|
||||
$params['update_time'] = getNormalDate();
|
||||
unset($params['disc_number']);
|
||||
unset($params['disabled']);
|
||||
Db::name('task_center')->where([
|
||||
'id' => $params['id']
|
||||
])->update($params);
|
||||
$this->success();
|
||||
|
||||
}
|
||||
|
||||
public function insertTaskCenter()
|
||||
{
|
||||
$params = $this->request->post();
|
||||
$params = convertKeysCamelToSnakeRecursive($params);
|
||||
$params['create_time'] = getNormalDate();
|
||||
unset($params['is_trusted']);
|
||||
Db::name('task_center')->insert($params);
|
||||
$this->success();
|
||||
}
|
||||
|
||||
public function deleteTaskCenter()
|
||||
{
|
||||
$id = $this->request->param('id');
|
||||
Db::name('task_center')->delete([
|
||||
'id' => $id
|
||||
]);
|
||||
|
||||
$this->success();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user