Commit 88ed5d68 authored by houdong's avatar houdong

新用户加富币

parent 17819499
...@@ -538,6 +538,9 @@ class PkTopAction extends IdentityAction{ ...@@ -538,6 +538,9 @@ class PkTopAction extends IdentityAction{
uc_user_synlogin(array('userId' => $info['user_id'], 'userName' => $info['user_name'], 'nick' => '', 'webId' => '')); uc_user_synlogin(array('userId' => $info['user_id'], 'userName' => $info['user_name'], 'nick' => '', 'webId' => ''));
$this->setLogin(array('userID'=>$info['user_id'],'userName'=>$info[' user_name'],'nick'=>'')); $this->setLogin(array('userID'=>$info['user_id'],'userName'=>$info[' user_name'],'nick'=>''));
} }
//新用户注册送150富币
D('CofCoin')->addMoneyForNewUser($info['user_id'],$info['user_name'],$mobile);
return $info; return $info;
} }
......
...@@ -12,7 +12,7 @@ class CofCoinModel extends Model ...@@ -12,7 +12,7 @@ class CofCoinModel extends Model
/** @var int 邀请好友全民炼股参赛成功 */ /** @var int 邀请好友全民炼股参赛成功 */
const TYPE_INVITA_QM = 26; const TYPE_INVITA_QM = 26;
const TYPE_NEW_USER = 30;
/** /**
* 任务-被邀请参加全民后奖励富币 * 任务-被邀请参加全民后奖励富币
...@@ -98,6 +98,17 @@ class CofCoinModel extends Model ...@@ -98,6 +98,17 @@ class CofCoinModel extends Model
} }
return true; return true;
} }
//新用户注册送150富币
public function addMoneyForNewUser($uid,$uname,$mobile){
M()->db(10, C('DB_CONFIG_DEMO'))->table('cofool_coin_user')->add(['user_id' =>$uid,'coin'=>150,'add_time'=>time()]);
$typeId=CofCoinModel::TYPE_NEW_USER;
$typeData = M()->db(10, C('DB_CONFIG_DEMO'))->table('cofool_coin_type')->where(['type_id' =>$typeId])->find();
$addData = ['user_id' =>$uid,'user_name' =>$uname,'mobile' =>$mobile,'title' => $typeData['type_name'],
'coin_change' => $typeData['coin'],'add_time' => time(),'type_id' =>$typeId];
M()->db(10, C('DB_CONFIG_DEMO'))->table('cofool_coin_detail')->add($addData);
}
} }
?> ?>
\ No newline at end of file
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