make(ProductReplyRepository::class); $total = $productReplyRepository->productTotalRate($productId); if (!$total) return $job->delete(); $rate = bcmul($total['total_rate'], $total['total_count'], 1); app()->make(ProductRepository::class)->baseUpdate($productId, [ 'rate' => $rate, 'reply_count' => $total['total_count'] ]); $data = $productReplyRepository->getWhere(['product_id' => $productId],'mer_id'); $merchantRate = $productReplyRepository->merchantTotalRate($data['mer_id']); app()->make(MerchantRepository::class)->update($data['mer_id'],$merchantRate); $job->delete(); } public function failed($data) { // TODO: Implement failed() method. } }