控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MemberGroup.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 会员组模型
  13. // +----------------------------------------------------------------------
  14. namespace app\member\model;
  15. use think\Model;
  16. class MemberGroup extends Model
  17. {
  18. //生成会员组缓存
  19. public function membergroup_cache()
  20. {
  21. $data = $this->order('listorder desc')->select();
  22. if ($data) {
  23. $data = $data->toArray();
  24. } else {
  25. return;
  26. }
  27. $return = [];
  28. foreach ($data as $k => $v) {
  29. if ($v['expand']) {
  30. $v['expand'] = unserialize($v['expand']);
  31. } else {
  32. $v['expand'] = [];
  33. }
  34. $return[$v['id']] = $v;
  35. }
  36. cache("Member_Group", $return);
  37. return $return;
  38. }
  39. }