123456789101112131415161718192021222324252627282930 |
- <?php
- namespace Account\Lib;
- use Dever;
- class Project
- {
- public function getConfig($table)
- {
- $data = array();
- $project = Dever::db('account/config_project')->find(array('source' => $table));
- if ($project) {
- $data = Dever::db('account/config')->select(array('project_id' => $project['id']));
- }
- return $data;
- }
- public function getUsername($uid, $config_id)
- {
- $name = $uid;
- $info = Dever::db('account/config')->find($config_id);
- if ($info) {
- $project = Dever::db('account/config_project')->find($info['project_id']);
- $source = Dever::db($project['source'])->find($uid);
- if ($source) {
- return $source[$project['source_name']];
- }
- }
- return $name;
- }
- }
|