Browse Source

Merge branch 'phoenix' of http://120.24.33.109:11081/hyzjshwo/lanzu_api_hyperf into phoenix

master
Lemon 5 years ago
parent
commit
7e49ce4f7d
  1. 9
      app/Model/v3/OrderMain.php
  2. 3
      app/Service/v3/Implementations/OrderListService.php
  3. 6
      app/Service/v3/Implementations/PaymentService.php

9
app/Model/v3/OrderMain.php

@ -91,6 +91,15 @@ class OrderMain extends Model
return Shipping::getMessage($this->attributes['shipping_type']);
}
public function getNoteAttribute($value)
{
if ($this->attributes['refuse_refund_note'] || $this->attributes['total_refund_note']) {
return $this->attributes['refuse_refund_note'] ?: $this->attributes['total_refund_note'];
}
return $value;
}
public function market()
{
return $this->belongsTo(Market::class, 'market_id', 'id');

3
app/Service/v3/Implementations/OrderListService.php

@ -161,7 +161,8 @@ class OrderListService implements OrderListServiceInterface
->with(['orders' => function($query) {
$query->with('store');
}])
->where(['user_id' => $userId, 'type' => OrderType::OFFLINE]);
->where(['user_id' => $userId, 'type' => OrderType::OFFLINE])
->whereIn('state', [OrderState::PAID,OrderState::DELIVERY,OrderState::COMPLETED]);
$paginate = $builder->orderBy('created_at', 'desc')->paginate($pagesize);
$orders = $paginate->toArray();

6
app/Service/v3/Implementations/PaymentService.php

@ -130,12 +130,8 @@ class PaymentService implements PaymentServiceInterface
if ($result['return_code'] == 'SUCCESS' && isset($result['result_code']) && $result['result_code'] == "SUCCESS") {
return true;
} else {
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL);
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL,$result['err_code_des']);
}
return $result;
} catch (\Exception $e) {
$this->log->event(LogLabel::ORDER_PAYMENT_LOG, ['payment_do_exception_msg' => $e->getMessage()]);
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL, '[退款失败]'.$e->getMessage());

Loading…
Cancel
Save