调整端
parent
55b389ffd7
commit
9c22fad094
|
|
@ -140,10 +140,7 @@ class AppVersionController extends AdminController
|
|||
$form->hidden('apk_link');
|
||||
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->cate && $form->cate ==3) {
|
||||
$form->cate = 2;
|
||||
}
|
||||
$apk_link = 'apk_link'.$form->cate;
|
||||
$apk_link = 'apk_link'.($form->cate != 3 ??2);
|
||||
$form->apk_link = $form->$apk_link;
|
||||
|
||||
$form->deleteInput('apk_link1');
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class AfterSaleShippingFill extends Form implements LazyRenderable
|
|||
/** 处理补发逻辑 **/
|
||||
//获取售后商品数量
|
||||
$fillQuantity = $afterSale->num;
|
||||
$packageProduct = OrderPackageProduct::where('order_product_id', $afterSale->order_product_id)->where('quantity', '>', $fillQuantity)->first();
|
||||
$packageProduct = OrderPackageProduct::where('order_product_id', $afterSale->order_product_id)->where('quantity', '>=', $fillQuantity)->first();
|
||||
if (!$packageProduct) {
|
||||
throw new BizException('补发包裹未找到或者售后补发数量异常');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,15 @@ class AfterSaleVerify extends Form implements LazyRenderable
|
|||
$afterSale = AfterSale::where('state', AfterSale::STATE_VERIFY)->findOrFail($this->payload['id']);
|
||||
if ($input['state'] == 3) {//审核通过
|
||||
$amount = Arr::get($input, 'amount', 0);
|
||||
if ($amount > $afterSale->orderProduct->total_amount) {
|
||||
$afterSale->load(['order', 'order.afterSales']);
|
||||
$finishedAfterSale = $afterSale->order->afterSales->filter(function ($items) {
|
||||
if ($items->state == AfterSale::STATE_FINISH && in_array($items->type, [AfterSale::TYPE_REFUND_AND_RETURN, AfterSale::TYPE_REFUND, Aftersale::TYPE_CHANGE])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if ($amount > ($afterSale->orderProduct->total_amount - $finishedAfterSale->sum('amount'))) {
|
||||
throw new BizException('退款金额不能大于商品实付金额');
|
||||
}
|
||||
$afterSaleService->verify($afterSale, $input['remarks3'], (int) Arr::get($input, 'amount', 0));
|
||||
|
|
|
|||
Loading…
Reference in New Issue