| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- /**
- *
- * @copyright ©2020 点小铺
- * @author hanj
- * @link: https://dyuit.com
- * Created by VSCode
- */
- namespace app\common\model;
- use app\common\model\store\User;
- /**
- * Class CertificateApply
- *
- * @Author: Yeshihao
- * @DateTime: 2024/11/26 13:38
- * @package app\common\model
- */
- class CertificateApply extends BaseModel
- {
- protected $name = 'certificate_apply';
- protected $type = [
- 'certificate_ids' => 'array',
- 'result_data' => 'array',
- 'category_ids' => 'array',
- ];
- /**
- * [getStatusTextAttr]
- *
- * @Author: Yeshihao
- * @DateTime: 2024/11/28 10:06
- * @param $value
- * @param $data
- * @return string
- */
- public function getStatusTextAttr($value, $data)
- {
- $arr = [10 => '待审核', 20 => '审核通过', 30 => '审核失败'];
- return $arr[$data['status']] ?? '';
- }
- /**
- * [store]
- * 提交人
- *
- * @Author: Yeshihao
- * @DateTime: 2024/11/27 18:33
- * @return \think\model\relation\BelongsTo
- */
- public function storeUser()
- {
- return $this->belongsTo(User::class, 'store_user_id', 'store_user_id');
- }
- /**
- * [apply]
- * 申请人
- *
- * @Author: Yeshihao
- * @DateTime: 2024/11/27 18:33
- * @return \think\model\relation\BelongsTo
- */
- public function applyUser()
- {
- return $this->belongsTo(User::class, 'apply_user_id', 'store_user_id');
- }
- /**
- * 文章详情
- *
- * @param $id
- * @return null|static
- * @throws \think\exception\DbException
- */
- public static function detail($id)
- {
- return self::get($id);
- }
- /**
- * 软删除
- *
- * @return false|int
- */
- public function setDelete()
- {
- return $this->save(['is_delete' => 1]);
- }
- }
|