优化数据

This commit is contained in:
2021-07-06 11:52:17 +08:00
parent 06ca4a9ec3
commit 15be3f7b3f

View File

@@ -145,7 +145,7 @@ class User extends Authenticatable
* @param string $date
* @return int
*/
public function getCouponCount($type, $date = '')
public function getCouponCount($type, $date = ''): int
{
$data = $this->checkCouponCount($date);
@@ -169,7 +169,6 @@ class User extends Authenticatable
*/
public function checkCouponCount($date)
{
$date = $date ? 'today' : 'all';
$name = "user_{$this->id}_coupon_count_date_{$date}";
if (Cache::has($name)) {