Authored by 郭成尧

代码注解

... ... @@ -20,7 +20,6 @@ class CouponData
* @param $uid 用户ID
* @param $contentCode 资源码
* @return array|mixed
* @internal param $contentCode
*/
public static function getCouponRousource($contentCode, $uid)
{
... ...
... ... @@ -22,6 +22,7 @@ class CouponFloorProcess
*/
public static function getContent($data)
{
// tar debug
// self::debugOut($data);
$result = array();
... ... @@ -146,10 +147,10 @@ class CouponFloorProcess
/**
*
* 数据输出
* 辅助方法 Debug 数据输出
*
* @param $data
* @param bool $is_exit
* @param bool $is_exit 输出后是否中断执行
*/
public static function debugOut($data, $is_exit = true)
{
... ...
... ... @@ -6,8 +6,8 @@
* Date: 2016/4/11
* Time: 16:31
*/
use LibModels\Wap\Coupon\CouponData;
use Action\AbstractAction;
use LibModels\Wap\Coupon\CouponData;
use Plugin\DataProcess\CouponFloorProcess;
use Plugin\Helpers;
... ... @@ -27,11 +27,11 @@ class CouponController extends AbstractAction
));
$result = array();
// 正常接口调用
// $uid = $this->getUid();
// 调用模拟接口
// $resource = $this->getFloor();
$resource = CouponData::getCouponRousource('b38b9c4f1c76f89533e9214629b458e4', 8040277);
// $resource = CouponData::getCouponRousource($receiveData['contentCode'],$uid);
// 数据写死,调用接口,测试使用
$resource = CouponData::getCouponRousource('b38b9c4f1c76f89533e9214629b458e4', 8040277);
if (isset($resource['code']) && $resource['code'] == 200) {
$result = CouponFloorProcess::getContent($resource['data']);
}
... ... @@ -72,7 +72,7 @@ class CouponController extends AbstractAction
}
} else {
// 登录后调用领券接口
$result = CouponData::receiveCoupon($this->getUid(),$receiveData['couponID']);
$result = CouponData::receiveCoupon($this->getUid(), $receiveData['couponID']);
switch ($result['code']) {
case 200:
$returnData = array(
... ... @@ -92,39 +92,6 @@ class CouponController extends AbstractAction
}
/**
* 领券接口模拟
*
* @param $couponId
* @return array
* @internal param $couponId
*/
public function getCouponHandler($couponId)
{
if ($couponId) {
$result['alg'] = 'SALT_MD5';
$result['code'] = 200;
$result['data'] = '';
$result['md5'] = '50d19f5f5098c34607018f144baec14a';
$result['message'] = '操作成功';
} else {
$result['alg'] = 'SALT_MD5';
$result['code'] = 402;
$result['data'] = '';
$result['md5'] = '50d19f5f5098c34607018f144baec14a';
$result['message'] = '操作失败';
}
/* // 组合接口参数
$params['method'] = 'app.promotion.getCoupon';
$params['couponId'] = $couponId;
$params['uid'] = $this->getUid();
$result = \Api\YohobuyH5::get(\Api\YohobuyH5::SERVICE_URL, $params);*/
return $result;
}
/**
* 判断是否是 APP
*
* @return bool
... ... @@ -134,103 +101,4 @@ class CouponController extends AbstractAction
return (null !== $this->get('app_version'));
}
/**
* 模拟后台接口数据
*
* @return array
*/
public function getFloor()
{
$result = array();
$result = [
'alg' => 'SALT_MD5',
'code' => 200,
'data' => [
0 => [
'data' => [
'list' => [
0 => [
'couponID' => 2516,
'status' => 1,
'goShopping' => 'http://item.m.yohobuy.com/product/pro_325933_419711/XiongJiaYouPin619081838990XiongJiaYouPinChuangYiLanRenTanZhuTuiKuan.html',
'image' => [
'src' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/01/02f639de49d79ece0cf86a2f214be781da.jpg?imageView/2/w/640/h/200',
'url' => 'http://2percent.yohobuy.com/?gender=2,3\n',
],
'isShow' => 'YES',
'title' => '标题内容',
],
],
],
'template_id' => 1111253,
'template_name' => 'getCoupon'
],
1 => [
'data' => [
'list' => [
0 => [
'couponID' => 200,
'status' => 3,
'goShopping' => 'http://item.m.yohobuy.com/product/pro_325933_419711/XiongJiaYouPin619081838990XiongJiaYouPinChuangYiLanRenTanZhuTuiKuan.html',
'image' => [
'src' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/01/02f639de49d79ece0cf86a2f214be781da.jpg?imageView/2/w/640/h/200',
'url' => 'http://2percent.yohobuy.com/?gender=2,3\n',
],
'isShow' => 'YES',
'title' => '标题内容',
],
],
],
'template_id' => 1111257,
'template_name' => 'getCoupon'
],
2 => [
'data' => [
'list' => [
0 => [
'couponID' => 1565,
'status' => 2,
'goShopping' => 'http://item.m.yohobuy.com/product/pro_325933_419711/XiongJiaYouPin619081838990XiongJiaYouPinChuangYiLanRenTanZhuTuiKuan.html',
'image' => [
'src' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/01/02f639de49d79ece0cf86a2f214be781da.jpg?imageView/2/w/640/h/200',
'url' => 'http://2percent.yohobuy.com/?gender=2,3\n',
],
'isShow' => 'YES',
'title' => '标题内容',
],
],
],
'template_id' => 1111255,
'template_name' => 'getCoupon'
],
3 => [
'data' => [
'list' => [
0 => [
'src' => 'http://img11.static.yhbimg.com/yhb-img01/2016/04/13/06/019bd2c1581f881c8ea22daf0e39a4a9ab.png?imageView/2/w/640/h/200',
'url' => []
],
1 => [
'src' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/13/06/02576fa876ccfbfe0648b4e2dabb989b6f.png?imageView/2/w/640/h/200',
'url' => []
],
2 => [
'src' => 'http://img11.static.yhbimg.com/yhb-img01/2016/04/13/06/01362e8c56fd6ac56ad3852b6a192e5336.png?imageView/2/w/640/h/200',
'url' => []
],
],
'speed' => '3'
],
'template_id' => 1111253,
'template_intro' => '轮播banner',
'template_name' => 'carousel_banner'
],
],
'md5' => '8febf00780011298f4a0530b6441827b',
'message' => '请求成功'
];
return $result;
}
}
\ No newline at end of file
... ...