count("id"); } /**消费者已使用优惠券总数 * @param string $userCode * * * @return int */ public function consumerUsedTotalCoupon($userCode) { return Coupon::where("consumer_code", $userCode)->where("is_verificated", Coupon::is_verificated_on)->count("id"); } /**消费者已使用优惠券总数 * @param string $userCode * * * @return int */ public function consumerNotUsedTotalCoupon($userCode) { return Coupon::where("consumer_code", $userCode)->where("is_verificated", Coupon::is_verificated_off)->count("id"); } /**消费者已使用优惠券总数 * @param string $userCode * * * @return array * @throws \Exception */ public function consumerCouponList($userCode, $page, $size) { return Coupon::findList(["consumer_code" => $userCode], [], $page, $size, null, ["id" => "desc"]); } }