find($id); } else { $data = false; } return $data; } # 获取角色 public function getRole() { $role = Dever::db('factory/member')->config['role']; $html = ' 全选'; $info = $this->getData(); foreach ($role as $k => $v) { $checked = ''; if ($info && $info['role_id']) { $temp = explode(',', $info['role_id']); if (in_array($k, $temp)) { $checked = 'checked'; } } $html .= ' '.$v.' '; } return $html; } # 订单列表 public function getList() { $data = Dever::db('factory/member')->list(array('factory_id' => $this->id)); $html = ''; if ($data) { $role = Dever::db('factory/member')->config['role']; foreach ($data as $k => $v) { $edit = Dever::url('user_edit?id=' . $v['id'], 'factory'); $temp = explode(',', $v['role_id']); $v['role_name'] = array(); foreach ($temp as $k1 => $v1) { if (isset($role[$v1])) { $v['role_name'][] = $role[$v1]; } } $v['role_name'] = implode(',', $v['role_name']); $cdate = date('Y-m-d H:i', $v['cdate']); $button = ''; if ($v['state'] == 1) { $state = 2; } else { $state = 1; } $del = Dever::url('admin/user.del?id=' . $v['id'] . '&state=' . $state, 'factory'); if ($state == 2) { $button .= ' '; } else { $button .= ' '; } $html .= '