From 30563323a53b0d0260c97d08a9e8bd4cc8227a95 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Sat, 13 Dec 2025 18:03:52 +0800
Subject: [PATCH] 完成级差奖 完成平级奖
---
admin/app/common/model/release/Project.php | 70 +++++++++++++++++++++++++++++++++++
1 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/admin/app/common/model/release/Project.php b/admin/app/common/model/release/Project.php
new file mode 100644
index 0000000..7581ba8
--- /dev/null
+++ b/admin/app/common/model/release/Project.php
@@ -0,0 +1,70 @@
+<?php
+
+namespace app\common\model\plus\release;
+
+use app\common\model\BaseModel;
+
+/**
+ * 项目模型
+ */
+class Project extends BaseModel
+{
+ protected $name = 'release_project';
+ protected $pk = 'project_id';
+
+
+ /**
+ * 关联上传图片表
+ */
+ public function image()
+ {
+ return $this->hasMany('app\\common\\model\\plus\\release\\ReleaseProjectImage', 'project_id', 'id')->order(['id' => 'asc']);
+ }
+
+ /**
+ * 关联分类
+ * @return \think\model\relation\BelongsTo
+ */
+ public function category()
+ {
+ return $this->belongsTo('app\\common\\model\\plus\\release\\ReleaseCategory','category_id','category_id');
+ }
+
+ /**
+ * 关联
+ * @return \think\model\relation\BelongsTo
+ */
+ public function user()
+ {
+ return $this->belongsTo('app\\common\\model\\user\\User','user_id','user_id');
+ }
+
+
+
+ /**
+ * 关联多标签表
+ */
+ public function tag()
+ {
+ return $this->hasMany('app\\common\\model\\plus\\release\\Tag', 'tag_id', 'tag_id');
+ }
+
+ /**
+ * 获取详情
+ */
+ public static function detail($project_id)
+ {
+ return (new static())->with(['image'])->find($project_id);
+ }
+
+ /**
+ * 获取列表记录
+ */
+ public function getAll()
+ {
+ return $this->where('is_delete', '=', 0)
+ ->field('project_id,name')
+ ->order(['sort' => 'asc', 'create_time' => 'asc'])
+ ->select();
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.2