mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
库存扣减
This commit is contained in:
parent
94ccd1e01c
commit
8840d1a719
@ -14,6 +14,16 @@ class BusinessOrderResource extends JsonResource
|
|||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
return parent::toArray($request);
|
$data = parent::toArray($request);
|
||||||
|
$data['confirm_at'] = date('Y-m-d H:i:s', $data['confirm_at'] / 1000);
|
||||||
|
$map = ['未发货', '已发货', '部分发货', "已收货", '' => ''];
|
||||||
|
$data['shipping_status'] = $map[$data['shipping_status']] ?? '';
|
||||||
|
$map = ['帮忙团订单', '自卖团订单', '' => ''];
|
||||||
|
$data['is_supplier'] = $map[$data['is_supplier']] ?? '';
|
||||||
|
$map = ['未取消', '已取消', '' => ''];
|
||||||
|
$data['cancel_status'] = $map[$data['cancel_status']] ?? '';
|
||||||
|
$map = ['未发起售后 ', '退款中', '退款成功', '待处理', '拒绝退款', '待(顾客)退货', '待(团长)确认退货', '撤销', '撤销', '(系统)关闭' => ''];
|
||||||
|
$data['after_sales_status'] = $map[$data['after_sales_status']] ?? '';
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,36 +62,6 @@ class BusinessOrder extends Model
|
|||||||
'order_sn',
|
'order_sn',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getConfirmAtAttribute($value)
|
|
||||||
{
|
|
||||||
return date('Y-m-d H:i:s', $value / 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getShippingStatusAttribute($value)
|
|
||||||
{
|
|
||||||
$map = ['未发货', '已发货', '部分发货',"已收货", '' => ''];
|
|
||||||
|
|
||||||
return $map[$value];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIsSupplierAttribute($value)
|
|
||||||
{
|
|
||||||
$map = ['帮忙团订单', '自卖团订单', '' => ''];
|
|
||||||
|
|
||||||
return $map[$value];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCancelStatusAttribute($value)
|
|
||||||
{
|
|
||||||
$map = ['未取消', '已取消', '' => ''];
|
|
||||||
|
|
||||||
return $map[$value];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAfterSalesStatusAttribute($value)
|
|
||||||
{
|
|
||||||
return empty($value) ? '未售后' : '有售后';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function items()
|
public function items()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -161,7 +161,7 @@ abstract class BusinessClient
|
|||||||
if (strlen($paramsJson) > 1024) {
|
if (strlen($paramsJson) > 1024) {
|
||||||
$paramsJson = '';
|
$paramsJson = '';
|
||||||
}
|
}
|
||||||
if (!in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list',"pdd.ktt.after.sales.increment.list"], true)) {
|
if (!in_array($params['type'], ['pdd.ktt.increment.order.query', 'pdd.ktt.order.list',"pdd.ktt.after.sales.increment.list","pdd.ktt.order.get"], true)) {
|
||||||
$log = new Log();
|
$log = new Log();
|
||||||
$log->module = 'plat';
|
$log->module = 'plat';
|
||||||
$log->action = $method;
|
$log->action = $method;
|
||||||
|
|||||||
@ -185,7 +185,6 @@ class KuaiTuanTuan extends BusinessClient
|
|||||||
if (!isset($res[$responseName]['order_info'])) {
|
if (!isset($res[$responseName]['order_info'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryOrder = $res[$responseName]['order_info'];
|
$queryOrder = $res[$responseName]['order_info'];
|
||||||
$needUpdate = false;
|
$needUpdate = false;
|
||||||
if ($order->shipping_status != $queryOrder['shipping_status']) {
|
if ($order->shipping_status != $queryOrder['shipping_status']) {
|
||||||
@ -196,11 +195,12 @@ class KuaiTuanTuan extends BusinessClient
|
|||||||
$order->cancel_status = $queryOrder['cancel_status'];
|
$order->cancel_status = $queryOrder['cancel_status'];
|
||||||
$needUpdate = true;
|
$needUpdate = true;
|
||||||
}
|
}
|
||||||
if ($order->after_sales_status!= $queryOrder['cancel_status']) {
|
if ($order->after_sales_status != $queryOrder['after_sales_status']) {
|
||||||
//售后状态更新
|
//售后状态更新
|
||||||
$order->after_sales_status = $queryOrder['after_sales_status'];
|
$order->after_sales_status = $queryOrder['after_sales_status'];
|
||||||
$needUpdate = true;
|
$needUpdate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($needUpdate) {
|
if ($needUpdate) {
|
||||||
$goodsSkuNum = 0;
|
$goodsSkuNum = 0;
|
||||||
foreach ($queryOrder['sub_order_list'] as $item) {
|
foreach ($queryOrder['sub_order_list'] as $item) {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class MiaoXuan extends BusinessClient
|
|||||||
$order->cancel_status = $queryOrder['cancel_status'];
|
$order->cancel_status = $queryOrder['cancel_status'];
|
||||||
$needUpdate = true;
|
$needUpdate = true;
|
||||||
}
|
}
|
||||||
if ($order->after_sales_status!= $queryOrder['cancel_status']) {
|
if ($order->after_sales_status!= $queryOrder['after_sales_status']) {
|
||||||
//售后状态更新
|
//售后状态更新
|
||||||
$order->after_sales_status = $queryOrder['after_sales_status'];
|
$order->after_sales_status = $queryOrder['after_sales_status'];
|
||||||
$needUpdate = true;
|
$needUpdate = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user