Authored by Rock Zhang

走通元宵节抽签活动所有流程(接口暂时未提供)

Code Review By Rock Zhang
... ... @@ -42,6 +42,13 @@ class HuodongAction extends Controller_Abstract
protected $_data;
/**
* 是否是应用访问标志位
*
* @var boolean
*/
protected $_isApp;
/**
* 初始化
*/
public function init()
... ... @@ -58,6 +65,9 @@ class HuodongAction extends Controller_Abstract
if (isset($config->css->url)) {
$this->_view->assign('imgUrl', $config->img->url);
}
// 判断是否是应用访问, 拼接APP需要的URL参数
$this->_isApp = (null !== $this->get('app_version') || null !== $this->get('uid'));
}
/**
... ... @@ -196,7 +206,7 @@ class HuodongAction extends Controller_Abstract
* @param string $name cookie的名字
* @param string $value cookie的值
* @param integer $expire cookie过期时间
* @param integer $path cookie可用的路径
* @param string $path cookie可用的路径
* @param string $domain cookie可用域名
*/
protected function setCookie($name, $value, $expire = 0, $path = '/', $domain = '.yohobuy.com')
... ...
... ... @@ -18,7 +18,7 @@
<div class="title">
生日
</div>
<input type="date" name="birthday" value="2011-12-13">
<input type="date" name="birthday" value="{{birthday}}">
</div>
<div class="gender">
<div class="title">
... ...
<?php
namespace Cuxiao;
use LibModels\Wap\Home\UserData;
/**
* Created by PhpStorm.
* User: Gtskk
* Date: 2016/2/18
* Time: 16:26
*
* @name YuanxiaoModel
* @package models/Cuxiao
* @author Gtskk(tttt6399998@126.com)
*/
class YuanxiaoModel
{
/**
* 处理用户详情数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的个人详情数据
*/
public static function getUserProfileData($uid)
{
$result = array(
'birthday' => '2000-01-01',
'gender' => 0
);
// 调用接口获取个人详情
$userData = UserData::userData($uid);
// 处理个人详情数
if (isset($userData['data']) && !empty($userData['data'])) {
$result['birthday'] = $userData['data']['birthday'] ?: '2000-01-01';
$result['gender'] = $userData['data']['gender'] == 1 ? '男' : '女';
}
return $result;
}
}
\ No newline at end of file
... ...