model = $cardRidingUseLog; } /** * 该订单是否使用过骑行卡 * @param $order_id int 订单id * @param $card_id int 用户骑行卡id * @return mixed * User:Fx * */ public function isUseThisCard($order_id, $card_id) { return $this->model->where('card_riding_user_bags_id', $card_id)->where('order_id', $order_id)->first(); } /** * 该订单是否使用过骑行卡 * @param $order_id int 订单id * @return mixed * User:Fx * */ public function isUseThisCardByOrderId($order_id) { return $this->model->where('order_id', $order_id)->first(); } public function isUseDayNumsByCardId($card_id) { return $this->model->where('card_riding_user_bags_id', $card_id)->whereDate('created_at', date('Y-m-d'))->count(); } }