ExploreSet.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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\store\model;
  13. use app\common\model\store\ExploreSet as SettingModel;
  14. /**
  15. * 系统设置模型
  16. * Class Setting
  17. * @package app\store\model
  18. */
  19. class ExploreSet extends SettingModel
  20. {
  21. /**
  22. * 探秘体验设置
  23. * @param $type
  24. * @param $params
  25. * @return bool
  26. */
  27. public function edit($type,$params)
  28. {
  29. // 设置项详情记录
  30. $model = self::detail($type) ?: $this;
  31. // 更新记录
  32. return $model->save([
  33. 'external_url' => $params['external_url']??'',
  34. 'ali_url' => $params['ali_url']??'',
  35. 'contents' => $params['contents']??'',
  36. 'types' => $type,
  37. 'update_time' => time(),
  38. ]) !== false;
  39. }
  40. }