|
|
@@ -119,6 +119,33 @@ class OrderClass extends BaseClass
|
|
|
self::REFUND_YES => '有退款',
|
|
|
];
|
|
|
|
|
|
+ public static function confirmReach($order)
|
|
|
+ {
|
|
|
+ //订单如果没有发货,则先发货
|
|
|
+ if ($order->status == 2) {
|
|
|
+ self::orderSend($order, [], true);
|
|
|
+ }
|
|
|
+ $cgId = $order->purchaseId ?? 0;
|
|
|
+ $cg = PurchaseClass::getById($cgId, true);
|
|
|
+ if (empty($cg)) {
|
|
|
+ util::fail('没有找到采购信息');
|
|
|
+ }
|
|
|
+ $customId = $order->customId ?? 0;
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
+ if (empty($custom)) {
|
|
|
+ util::fail('没有找到客户信息');
|
|
|
+ }
|
|
|
+ $shopId = $custom->shopId ?? 0;
|
|
|
+ $customShop = ShopClass::getById($shopId, true);
|
|
|
+ if (empty($customShop)) {
|
|
|
+ util::fail('没有找到客户的门店');
|
|
|
+ }
|
|
|
+ if (isset($customShop->pfShopId) && !empty($customShop->pfShopId)) {
|
|
|
+ util::fail('客户有批发店,请通知客户确认');
|
|
|
+ }
|
|
|
+ PurchaseClass::takeToPutIn($cg);
|
|
|
+ }
|
|
|
+
|
|
|
//订单发货主方法 ssh 20231119
|
|
|
public static function orderSend($order, $params, $allowRepeat = false)
|
|
|
{
|
|
|
@@ -128,7 +155,7 @@ class OrderClass extends BaseClass
|
|
|
if (empty($cgInfo)) {
|
|
|
util::fail('没有找到采购信息');
|
|
|
}
|
|
|
- PurchaseClass::orderFh($cgInfo, $params, $allowRepeat,true);
|
|
|
+ PurchaseClass::orderFh($cgInfo, $params, $allowRepeat, true);
|
|
|
}
|
|
|
|
|
|
//订单发货子方法 ssh 20231119
|