|
@@ -6,6 +6,62 @@ use Dever;
|
|
|
|
|
|
class Info
|
|
|
{
|
|
|
+ # 获取账户
|
|
|
+ public function getInfo($uid, $config_id = false)
|
|
|
+ {
|
|
|
+ if (!$config_id) {
|
|
|
+ $config = Dever::db('account/config')->one(array('type' => 1));
|
|
|
+ } else {
|
|
|
+ $config = Dever::db('account/config')->one($config_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($config) {
|
|
|
+ $where = array();
|
|
|
+ $where['uid'] = $uid;
|
|
|
+ $where['config_id'] = $config['id'];
|
|
|
+ $account = Dever::db('account/info')->one($where);
|
|
|
+ if ($account) {
|
|
|
+ return array('name' => $config['name'], 'cash' => $account['cash'], 'z_cash' => $account['z_cash'], 't_cash' => $account['t_cash']);
|
|
|
+ } else {
|
|
|
+ return array();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return array();
|
|
|
+ }
|
|
|
+
|
|
|
+ # 获取列表
|
|
|
+ public function getList($uid, $config_id = false, $type = false, $type_id = false)
|
|
|
+ {
|
|
|
+ if (!$config_id) {
|
|
|
+ $config = Dever::db('account/config')->one(array('type' => 1));
|
|
|
+ } else {
|
|
|
+ $config = Dever::db('account/config')->one($config_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($config) {
|
|
|
+ $where = array();
|
|
|
+ $where['uid'] = $uid;
|
|
|
+ $where['config_id'] = $config['id'];
|
|
|
+
|
|
|
+ $result = Dever::db('account/info_log')->getList($where);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($result) {
|
|
|
+ $type = Dever::db('account/config_type')->getData();
|
|
|
+ foreach ($result as $k => $v) {
|
|
|
+ $result[$k]['cdate'] = date('Y-m-d H:i:s', $v['cdate']);
|
|
|
+ if (isset($type[$v['type_id']])) {
|
|
|
+ $result[$k]['type_name'] = $type[$v['type_id']]['name'];
|
|
|
+ } else {
|
|
|
+ $result[$k]['type_name'] = '未知';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
public function test_api()
|
|
|
{
|
|
|
//return $this->up(1, 500, 'tixian', 'role_zijin', 'test');
|