Cathay
- Cathay 2019-10-15 已签到连续签到1天,获得了5个金钱
- Cathay 赞了说说舰长,昨天夸我很骚,这我就很难受,没想到,装了这么久居然被发现了。
- Cathay 赞了说说人生有好多遗憾,我现在的遗憾是北马和杭马都中了,接下来该怎么办?
- Cathay 2019-10-10 已签到连续签到1天,获得了5个金钱
- Cathay 2019-10-08 已签到连续签到1天,获得了5个金钱
- Cathay 赞了回答
从我贴的那个链接中 截两段话
图1:
认证状态不能保持,每一次请求都是通过 access token 实时认证的图2:
认证成功后 才会进行频率限制,所以 RateLimit 类的这个方法中public function beforeAction($action) { if ($this->user === null && Yii::$app->getUser()) { $this->user = Yii::$app->getUser()->getIdentity(false); } if ($this->user instanceof RateLimitInterface) { Yii::debug('Check rate limit', __METHOD__); $this->checkRateLimit($this->user, $this->request, $this->response, $action); } elseif ($this->user) { Yii::info('Rate limit skipped: "user" does not implement RateLimitInterface.', __METHOD__); } else { Yii::info('Rate limit skipped: user not logged in.', __METHOD__); } return true; }
并不会进入第一个 if 判断
- Cathay 2019-10-05 已签到连续签到1天,获得了5个金钱
- Cathay 2019-10-02 已签到连续签到3天,获得了15个金钱
你可以在fields里定一个值,等于你需要的with值,然后用toarray获取?
like this ?public function fields() { ..., // 想了一下,这样有点多余,直接 ’coupons‘就行了。 // return ArrayHelper::merge(parents::fields(), ['coupons']); 'coupons' => function() { return $this->coupons; } } public function getCoupons() { return $this-hasMany(Coupons::class, 'coupon_id' => 'id'); }