-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
card module. #464
Conversation
* | ||
* @return string $api_ticket api_ticket | ||
*/ | ||
public function cardApiTicket($jus = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jus
是什么?
@wangniuniu 命名规范有问题,变量,方法请统一使用驼峰 |
* | ||
* @return string | ||
*/ | ||
public function showQrCode_Url($ticket) |
There was a problem hiding this comment.
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 = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
驼峰
这可以是篇 PR 教程示范了 😂 |
* | ||
* @return array | ||
*/ | ||
public function getCardList($openid, $cardId = '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里我有点疑问(因为我对卡券 API 不是太熟悉)这里既然是获取卡券列表,为啥还有一个可选的 $cardId
呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用于获取用户卡包里的,属于该appid下所有可用卡券,包括正常状态和未生效状态。
卡券ID。不填写时默认查询当前appid下的卡券。
一张卡券 一个 用户 可以 领取 多张 每张的 code 不一样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tianye 好吧,got it.
@jinchun 这么巧,你也在此观光啊 |
public function modifyStock($cardId, $stock = 'increase', $value = 0) | ||
{ | ||
$params = []; | ||
$params['card_id'] = $cardId; |
There was a problem hiding this comment.
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,
];
@wangniuniu 加油,实在不好意思提得有点多,为了保证代码风格一致,希望不至于让你烦到不想改了。:smile: |
@overtrue 我正在改、、所以没有及时回复,受教了。哈哈 |
@wangniuniu 妞妞童鞋 赞~~~ |
@tianye 还请大神们多多指教 |
$type = strtolower($cardType); | ||
|
||
$cardInfo = []; | ||
$cardInfo['base_info'] = $baseInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 第 97 行
$card
改为$params
; - 代码合并
$cardInfo = [];
$cardInfo['base_info'] = $baseInfo;
这两行请合并:
$card = [
'base_info' => $baseInfo,
];
@wangniuniu 我看改得快差不多了,然后你可以在 PR 后观注下图的状态: 前面有红叉的表示不通过,点击后面的 |
@wangniuniu 然后有一个东西叫 PHP-CS-Fixer,它可以纠正你代码里的代码规范问题,比如对齐,留白这些简单的。当然最好还是看一下它修复了什么,这样便于以后写代码的时候就正确的写。 |
@overtrue 好的 |
卡券相关接口