123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- // +----------------------------------------------------------------------
- // | Yzncms [ 御宅男工作室 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2018 http://yzncms.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 御宅男 <530765310@qq.com>
- // +----------------------------------------------------------------------
-
- // +----------------------------------------------------------------------
- // | 会员组模型
- // +----------------------------------------------------------------------
- namespace app\member\model;
-
- use think\Model;
-
- class MemberGroup extends Model
- {
- //生成会员组缓存
- public function membergroup_cache()
- {
- $data = $this->order('listorder desc')->select();
- if ($data) {
- $data = $data->toArray();
- } else {
- return;
- }
- $return = [];
- foreach ($data as $k => $v) {
- if ($v['expand']) {
- $v['expand'] = unserialize($v['expand']);
- } else {
- $v['expand'] = [];
- }
- $return[$v['id']] = $v;
- }
- cache("Member_Group", $return);
- return $return;
- }
- }
|