走通元宵节抽签活动所有流程(接口暂时未提供)
Code Review By Rock Zhang
Showing
3 changed files
with
54 additions
and
2 deletions
@@ -42,6 +42,13 @@ class HuodongAction extends Controller_Abstract | @@ -42,6 +42,13 @@ class HuodongAction extends Controller_Abstract | ||
42 | protected $_data; | 42 | protected $_data; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | + * 是否是应用访问标志位 | ||
46 | + * | ||
47 | + * @var boolean | ||
48 | + */ | ||
49 | + protected $_isApp; | ||
50 | + | ||
51 | + /** | ||
45 | * 初始化 | 52 | * 初始化 |
46 | */ | 53 | */ |
47 | public function init() | 54 | public function init() |
@@ -58,6 +65,9 @@ class HuodongAction extends Controller_Abstract | @@ -58,6 +65,9 @@ class HuodongAction extends Controller_Abstract | ||
58 | if (isset($config->css->url)) { | 65 | if (isset($config->css->url)) { |
59 | $this->_view->assign('imgUrl', $config->img->url); | 66 | $this->_view->assign('imgUrl', $config->img->url); |
60 | } | 67 | } |
68 | + | ||
69 | + // 判断是否是应用访问, 拼接APP需要的URL参数 | ||
70 | + $this->_isApp = (null !== $this->get('app_version') || null !== $this->get('uid')); | ||
61 | } | 71 | } |
62 | 72 | ||
63 | /** | 73 | /** |
@@ -196,7 +206,7 @@ class HuodongAction extends Controller_Abstract | @@ -196,7 +206,7 @@ class HuodongAction extends Controller_Abstract | ||
196 | * @param string $name cookie的名字 | 206 | * @param string $name cookie的名字 |
197 | * @param string $value cookie的值 | 207 | * @param string $value cookie的值 |
198 | * @param integer $expire cookie过期时间 | 208 | * @param integer $expire cookie过期时间 |
199 | - * @param integer $path cookie可用的路径 | 209 | + * @param string $path cookie可用的路径 |
200 | * @param string $domain cookie可用域名 | 210 | * @param string $domain cookie可用域名 |
201 | */ | 211 | */ |
202 | protected function setCookie($name, $value, $expire = 0, $path = '/', $domain = '.yohobuy.com') | 212 | protected function setCookie($name, $value, $expire = 0, $path = '/', $domain = '.yohobuy.com') |
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | <div class="title"> | 18 | <div class="title"> |
19 | 生日 | 19 | 生日 |
20 | </div> | 20 | </div> |
21 | - <input type="date" name="birthday" value="2011-12-13"> | 21 | + <input type="date" name="birthday" value="{{birthday}}"> |
22 | </div> | 22 | </div> |
23 | <div class="gender"> | 23 | <div class="gender"> |
24 | <div class="title"> | 24 | <div class="title"> |
1 | +<?php | ||
2 | + | ||
3 | +namespace Cuxiao; | ||
4 | +use LibModels\Wap\Home\UserData; | ||
5 | + | ||
6 | +/** | ||
7 | + * Created by PhpStorm. | ||
8 | + * User: Gtskk | ||
9 | + * Date: 2016/2/18 | ||
10 | + * Time: 16:26 | ||
11 | + * | ||
12 | + * @name YuanxiaoModel | ||
13 | + * @package models/Cuxiao | ||
14 | + * @author Gtskk(tttt6399998@126.com) | ||
15 | + */ | ||
16 | +class YuanxiaoModel | ||
17 | +{ | ||
18 | + /** | ||
19 | + * 处理用户详情数据 | ||
20 | + * | ||
21 | + * @param int $uid 用户ID | ||
22 | + * @return array|mixed 处理之后的个人详情数据 | ||
23 | + */ | ||
24 | + public static function getUserProfileData($uid) | ||
25 | + { | ||
26 | + $result = array( | ||
27 | + 'birthday' => '2000-01-01', | ||
28 | + 'gender' => 0 | ||
29 | + ); | ||
30 | + | ||
31 | + // 调用接口获取个人详情 | ||
32 | + $userData = UserData::userData($uid); | ||
33 | + | ||
34 | + // 处理个人详情数 | ||
35 | + if (isset($userData['data']) && !empty($userData['data'])) { | ||
36 | + $result['birthday'] = $userData['data']['birthday'] ?: '2000-01-01'; | ||
37 | + $result['gender'] = $userData['data']['gender'] == 1 ? '男' : '女'; | ||
38 | + } | ||
39 | + | ||
40 | + return $result; | ||
41 | + } | ||
42 | +} |
-
Please register or login to post a comment