From ca425b889f3c1b5847ffc26a0229307f7f8ef43e Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Tue, 09 Dec 2025 16:11:31 +0800
Subject: [PATCH] 添加消费券 商户端添加页面diy

---
 admin/app/common/model/release/SupplyApply.php |   82 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/admin/app/common/model/release/SupplyApply.php b/admin/app/common/model/release/SupplyApply.php
new file mode 100644
index 0000000..ac51e21
--- /dev/null
+++ b/admin/app/common/model/release/SupplyApply.php
@@ -0,0 +1,82 @@
+<?php
+
+namespace app\common\model\plus\release;
+
+use app\common\model\BaseModel;
+use app\common\model\user\User as UserModel;
+
+/**
+ * 申请模型
+ */
+class SupplyApply extends BaseModel
+{
+    protected $name = 'release_supply_apply';
+    protected $pk = 'apply_id';
+
+    /**
+     * 申请状态
+     * @var array
+     */
+    public $applyStatus = [
+        10 => '待审核',
+        20 => '审核通过',
+        30 => '驳回',
+    ];
+
+    /**
+     * 申请时间
+     * @param $value
+     * @return false|string
+     */
+    public function getApplyTimeAttr($value)
+    {
+        return date('Y-m-d H:i:s', $value);
+    }
+
+    /**
+     * 审核时间
+     * @param $value
+     * @return false|int|string
+     */
+    public function getAuditTimeAttr($value)
+    {
+        return $value > 0 ? date('Y-m-d H:i:s', $value) : 0;
+    }
+
+    /**
+     * 销商申请记录详情
+     * @param $where
+     * @return array|\think\Model|null
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public static function detail($where)
+    {
+        $filter = is_array($where) ? $where : ['apply_id' => $where];
+        return (new static())->where($filter)->find();
+    }
+
+    /**
+     * 审核状态
+     * @param $value
+     * @return array
+     */
+    public function getApplyStatusAttr($value)
+    {
+        $method = [10 => '待审核', 20 => '审核通过', '30' => '驳回'];
+        return ['text' => $method[$value], 'value' => $value];
+    }
+
+    /**
+     * 审核方式
+     * @param $value
+     * @return array
+     */
+    public function getApplyTypeAttr($value)
+    {
+        $method = [10 => '后台审核', 20 => '无需审核'];
+        return ['text' => $method[$value], 'value' => $value];
+    }
+
+}
\ No newline at end of file

--
Gitblit v1.9.2