123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 老猫 <thinkcmf@126.com>
- // +----------------------------------------------------------------------
- namespace app\portal\controller;
- use app\portal\model\UserinfoModel;
- use cmf\controller\HomeBaseController;
- class IndexController extends HomeBaseController {
- public function index() {
- $this->getList();
- return $this->fetch(':index');
- }
- private function getList() {
- $m_u = new UserinfoModel();
- $list = $m_u->getlist();
- $list = $list->toArray();
- foreach ($list as $key => $value) {
- $userid = $value['id'];
- $worktype = $m_u->getworktype($userid);
- if (empty($worktype)) {
- $worktype = [['workertypedisstr' => '普工']];
- }
- $list[$key]['worktype'] = $worktype;
- }
- // var_dump($list);
- $this->assign('list', $list);
- }
- }
|