From b05a3ea9116726673db338c781cd92f79cddff01 Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 10 Sep 2020 17:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/JsonRpc/OrderService.php | 9 +++++---- app/Model/v3/OrderMain.php | 4 ++++ app/Model/v3/ShoppingCart.php | 3 ++- app/Service/v3/Implementations/OrderOnlineService.php | 8 +------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/JsonRpc/OrderService.php b/app/JsonRpc/OrderService.php index f13b9cb..989833f 100644 --- a/app/JsonRpc/OrderService.php +++ b/app/JsonRpc/OrderService.php @@ -100,12 +100,13 @@ class OrderService implements OrderServiceInterface /** * 线上订单单笔退款 * 支持单商品、单店、整单 - * @param $global_order_id 全局总订单ID - * @param $child_order_id 主订单ID, - * @param $order_goods_id 订单商品ID + * @param $user_id *用户ID + * @param $global_order_id *全局总订单ID + * @param $child_order_id *主订单ID, + * @param $order_goods_id *订单商品ID * @param $note */ - public function onlineSingleRefund($global_order_id, $child_order_id, $order_goods_id, $note) + public function onlineSingleRefund($user_id, $global_order_id, $child_order_id, $order_goods_id, $note) { } diff --git a/app/Model/v3/OrderMain.php b/app/Model/v3/OrderMain.php index 9d4f06b..854043a 100644 --- a/app/Model/v3/OrderMain.php +++ b/app/Model/v3/OrderMain.php @@ -56,6 +56,10 @@ class OrderMain extends Model 'shipping_type_text', ]; + protected $casts = [ + 'global_order_id' => 'string' + ]; + public function getCreatedAtTextAttribute() { return date('Y-m-d H:i:s', $this->attributes['created_at']); diff --git a/app/Model/v3/ShoppingCart.php b/app/Model/v3/ShoppingCart.php index b07b814..e1d246c 100644 --- a/app/Model/v3/ShoppingCart.php +++ b/app/Model/v3/ShoppingCart.php @@ -3,10 +3,11 @@ namespace App\Model\v3; use App\Model\Model; +use Hyperf\Database\Model\SoftDeletes; class ShoppingCart extends Model { - + use SoftDeletes; protected $table = 'lanzu_shopping_cart'; protected $fillable = [ diff --git a/app/Service/v3/Implementations/OrderOnlineService.php b/app/Service/v3/Implementations/OrderOnlineService.php index b4f0e42..bbce864 100644 --- a/app/Service/v3/Implementations/OrderOnlineService.php +++ b/app/Service/v3/Implementations/OrderOnlineService.php @@ -244,13 +244,7 @@ class OrderOnlineService implements OrderOnlineServiceInterface // 校验订单总金额 if ($totalAmount != $totalMoney) { - throw new ErrorCodeException(ErrorCode::ORDER_TOTAL_AMOUNT_ERROR, json_encode([ - '计算的总订单金额:' => $totalAmount, - '前端的订单总金额:' => $totalMoney, - 'Delivery:' => $deliveryAmount, - 'Service:' => $serviceMoney, - 'Coupon:' => $couponMoney, - ])); + throw new ErrorCodeException(ErrorCode::ORDER_TOTAL_AMOUNT_ERROR); } $dataMain = [