ShareKey.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\index\model;
  13. use app\common\model\ShareKey as ShareKeyModel;
  14. /**
  15. * 系统设置模型
  16. * Class Setting
  17. * @package app\api\model
  18. */
  19. class ShareKey extends ShareKeyModel
  20. {
  21. /**
  22. * 获取积分名称
  23. * @return array|null|\think\Model
  24. */
  25. public static function getShareKey($key)
  26. {
  27. if (empty($key))return null;
  28. return static::where('key_string', $key)->find();
  29. }
  30. public static function delKey($key)
  31. {
  32. if (empty($key))return null;
  33. return static::where('key_string', $key)->update(['is_delete'=>1,'update_time'=>time()]);
  34. }
  35. }