Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

card module. #464

Merged
merged 7 commits into from
Jul 19, 2016
Merged

card module. #464

merged 7 commits into from
Jul 19, 2016

Conversation

wangniuniu
Copy link
Contributor

卡券相关接口

*
* @return string $api_ticket api_ticket
*/
public function cardApiTicket($jus = false)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jus 是什么?

@overtrue
Copy link
Collaborator

@wangniuniu 命名规范有问题,变量,方法请统一使用驼峰

@overtrue
Copy link
Collaborator

@wangniuniu 单元测试好像还是有问题:https://travis-ci.org/overtrue/wechat/jobs/145447933

*
* @return string
*/
public function showQrCode_Url($ticket)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showQrCode_Url 这是个什么写法?


$type = strtolower($cardType);

$card_info = [];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

驼峰

@jinchun
Copy link
Contributor

jinchun commented Jul 18, 2016

这可以是篇 PR 教程示范了 😂

*
* @return array
*/
public function getCardList($openid, $cardId = '')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里我有点疑问(因为我对卡券 API 不是太熟悉)这里既然是获取卡券列表,为啥还有一个可选$cardId 呢?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用于获取用户卡包里的,属于该appid下所有可用卡券,包括正常状态和未生效状态。
卡券ID。不填写时默认查询当前appid下的卡券。
一张卡券 一个 用户 可以 领取 多张 每张的 code 不一样

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianye 好吧,got it.

@ycrao
Copy link

ycrao commented Jul 18, 2016

@jinchun 这么巧,你也在此观光啊

public function modifyStock($cardId, $stock = 'increase', $value = 0)
{
$params = [];
$params['card_id'] = $cardId;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$params = [];
$params['card_id'] = $cardId;

可以考虑合并为:

$params = [
    'card_id' => $cardId,
];

@overtrue
Copy link
Collaborator

@wangniuniu 加油,实在不好意思提得有点多,为了保证代码风格一致,希望不至于让你烦到不想改了。:smile:

@wangniuniu
Copy link
Contributor Author

@overtrue 我正在改、、所以没有及时回复,受教了。哈哈

@tianye
Copy link
Contributor

tianye commented Jul 18, 2016

@wangniuniu 妞妞童鞋 赞~~~

@wangniuniu
Copy link
Contributor Author

@tianye 还请大神们多多指教

$type = strtolower($cardType);

$cardInfo = [];
$cardInfo['base_info'] = $baseInfo;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 第 97 行 $card 改为 $params
  2. 代码合并
$cardInfo = [];
$cardInfo['base_info'] = $baseInfo;

这两行请合并:

$card = [
   'base_info' => $baseInfo,
];

@overtrue
Copy link
Collaborator

@wangniuniu 我看改得快差不多了,然后你可以在 PR 后观注下图的状态:

image

前面有红叉的表示不通过,点击后面的 Details 查看详情。

@overtrue
Copy link
Collaborator

@wangniuniu 然后有一个东西叫 PHP-CS-Fixer,它可以纠正你代码里的代码规范问题,比如对齐,留白这些简单的。当然最好还是看一下它修复了什么,这样便于以后写代码的时候就正确的写。

@wangniuniu
Copy link
Contributor Author

@overtrue 好的

@overtrue overtrue merged commit bc44308 into w7corp:master Jul 19, 2016
overtrue added a commit that referenced this pull request Jul 20, 2016
overtrue added a commit that referenced this pull request Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants