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
e658b7ea88
  1. 2
      app/Controller/v3/WithdrawController.php
  2. 18
      app/JsonRpc/OrderService.php
  3. 1
      app/Model/v3/FinancialRecord.php
  4. 10
      app/Model/v3/Goods.php
  5. 2
      app/Service/v3/Implementations/FinancialRecordService.php
  6. 12
      app/Service/v3/Implementations/OrderOnlineService.php

2
app/Controller/v3/WithdrawController.php

@ -180,7 +180,7 @@ class WithdrawController extends BaseController
// 打款成功,写流水
if ($res === true) {
$this->financialService->storeWithdrawByWx($store->user_id, 0, $withdraw->real_cash);
$this->financialService->storeWithdrawByWx($store->user_id, $withdraw->id, $withdraw->real_cash);
}
}

18
app/JsonRpc/OrderService.php

@ -68,12 +68,13 @@ class OrderService implements OrderServiceInterface
}
/**
* 线上订单退款,整个订单退
* 线上订单退款,整个订单退,这个是专门用于处理用户的申请退款的同意退款操作
* @param $global_order_id
* @param $user_id
* @return array
*/
public function onlineRefund($global_order_id, $user_id){
public function onlineRefund($global_order_id, $user_id)
{
Db::beginTransaction();
try {
@ -95,4 +96,17 @@ class OrderService implements OrderServiceInterface
}
}
/**
* 线上订单单笔退款
* 支持单商品、单店、整单
* @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)
{
}
}

1
app/Model/v3/FinancialRecord.php

@ -49,6 +49,7 @@ class FinancialRecord extends Model
*/
const SOURCE_TYPE_NONE = 0;
const SOURCE_TYPE_ORDER = 1;
const SOURCE_TYPE_STORE_WITHDRAW = 2;
/**
* 流水类型,大的分类,<100是奖励分账等收入项 >=100是提现消费等支出项

10
app/Model/v3/Goods.php

@ -92,16 +92,6 @@ class Goods extends Model
return $this->attachmentService->switchImgToAliOss($value);
}
public function getTagsAttribute($value)
{
if($value){
$value = str_replace('"','',$value);
$value = explode(',',$value);
return $value;
}
return $value;
}
public function getMonthSalesAttribute()
{
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class);

2
app/Service/v3/Implementations/FinancialRecordService.php

@ -342,7 +342,7 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$source_id,
$money,
$user_type = UserType::STORE,
$source_type = FinancialRecord::SOURCE_TYPE_NONE,
$source_type = FinancialRecord::SOURCE_TYPE_STORE_WITHDRAW,
$money_type = FinancialRecord::MONEY_TYPE_STORE_WITHDRAW,
$desc = '商户提现',
$comment = '商户提现打款'

12
app/Service/v3/Implementations/OrderOnlineService.php

@ -244,7 +244,13 @@ class OrderOnlineService implements OrderOnlineServiceInterface
// 校验订单总金额
if ($totalAmount != $totalMoney) {
throw new ErrorCodeException(ErrorCode::ORDER_TOTAL_AMOUNT_ERROR);
throw new ErrorCodeException(ErrorCode::ORDER_TOTAL_AMOUNT_ERROR, json_encode([
'计算的总订单金额:' => $totalAmount,
'前端的订单总金额:' => $totalMoney,
'Delivery:' => $deliveryAmount,
'Service:' => $serviceMoney,
'Coupon:' => $couponMoney,
]));
}
$dataMain = [
@ -551,10 +557,6 @@ class OrderOnlineService implements OrderOnlineServiceInterface
{
$orderMain = $this->check($globalOrderId, $userId, OrderState::REFUNDING);
$orderMain->state = OrderState::REFUNDED;
if (!$orderMain->save()) {
throw new ErrorCodeException(ErrorCode::ORDER_REFUND_FAIL);
}
// 微信退款
if ($orderMain->pay_type == Payment::WECHAT) {

Loading…
Cancel
Save