Commit ccb220f1 by 冷斌

fix bug

parent da29e6c6
......@@ -106,6 +106,12 @@ class Api_User extends PhalApi_Api {
'source' => array('name' => 'source', 'type' => 'int', 'require' => true, 'desc' => '类型,1主播,2邀请,3家族'),
),
'getCash' => array(
'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
'source' => array('name' => 'source', 'type' => 'int', 'require' => true, 'desc' => '类型,1主播,2邀请,3家族'),
),
'setAttent' => array(
'uid' => array('name' => 'uid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '用户ID'),
'touid' => array('name' => 'touid', 'type' => 'int', 'min' => 1, 'require' => true, 'desc' => '对方ID'),
......@@ -1047,6 +1053,25 @@ class Api_User extends PhalApi_Api {
return $rs;
}
public function getCash() {
$rs = array('code' => 0, 'msg' => '', 'info' => array());
$uid=checkNull($this->uid);
$token=checkNull($this->token);
$checkToken=checkToken($uid,$token);
if($checkToken==700){
$rs['code'] = $checkToken;
$rs['msg'] = '您的登陆状态失效,请重新登陆!';
return $rs;
}
$domain = new Domain_User();
$result = $domain->getCash($uid, $this->source);
$rs['info'][0]=$result;
return $rs;
}
public function attentList()
{
$rs = array('code' => 0, 'msg' => '', 'info' => array());
......
......@@ -119,6 +119,15 @@ class Domain_User {
return $rs;
}
public function getCash($uid, $source) {
$rs = array();
$model = new Model_User();
$rs = $model->getCash($uid, $source);
return $rs;
}
public function setAttent($uid,$touid) {
$rs = array();
......
......@@ -295,6 +295,11 @@ class Model_User extends PhalApi_Model_NotORM
return $rs;
}
public function getCash($uid, $source) {
$rs = DI()->notorm->charge_rules->select('*')->where("uid = {$uid} and source = {$source} and status in (0 ,1)")->order('addtime desc')->fetchAll();
return $rs ? $rs : [];
}
/**
* 礼物明细
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment