工单列表

This commit is contained in:
2025-07-04 15:04:29 +08:00
parent b70fc6c4f8
commit 388747634a
7 changed files with 22 additions and 12 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
namespace app\ticket\logic;
use app\ticket\model\TicketCategorie;
use app\ticket\model\Categorie;
use support\Log;
use support\exception\BusinessException;
@@ -13,20 +13,20 @@ class CategorieLogic
$where = [];
$size = $params['size'] ?? 10;
$current = $params['current'] ?? 1;
return TicketCategorie::with('translation')->where($where)->paginate($size, ['*'], 'page', $current);
return Categorie::with('translation')->where($where)->paginate($size, ['*'], 'page', $current);
}
public function getAll($params)
{
$where = [];
$where[] = ['status', '=', 1];
return TicketCategorie::with('translation')->where($where)->get();
return Categorie::with('translation')->where($where)->get();
}
public function add(array $data)
{
try {
return TicketCategorie::create($data);
return Categorie::create($data);
} catch (\Throwable $e) {
Log::error('分类创建失败', [
'data' => $data,
@@ -39,7 +39,7 @@ class CategorieLogic
public function edit(array $data)
{
try {
$categorie = TicketCategorie::updateOrCreate(['id' => $data['id']], $data);
$categorie = Categorie::updateOrCreate(['id' => $data['id']], $data);
return $categorie;
} catch (\Throwable $e) {
Log::error('分类编辑失败', [
@@ -53,7 +53,7 @@ class CategorieLogic
public function delete(int $id)
{
try {
$categorie = TicketCategorie::where(['id'=>$id])->delete();
$categorie = Categorie::where(['id'=>$id])->delete();
return $categorie;
} catch (\Throwable $e) {
Log::error('分类删除失败', [