mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 14:40:44 +00:00
库存扣减
This commit is contained in:
parent
56bca0063a
commit
cc24e05e1a
@ -44,19 +44,17 @@ class KttOrderSyncStatus extends Command
|
||||
public function handle()
|
||||
{
|
||||
$startTime = Carbon::now()->subDays(15)->getPreciseTimestamp(3);
|
||||
$shops = Shop::query()->where('plat_id', Shop::$PLAT_KTT)->where('status', Shop::$STATUS_AUTHORIZED)->get();
|
||||
BusinessOrder::query()->where('confirm_at', '>=', $startTime)
|
||||
->where('shipping_status',BusinessOrderShippingStatus::UNSHIP)
|
||||
->where('cancel_status',0)
|
||||
->chunk(200, function ($orders) use ($shops) {
|
||||
->chunk(200, function ($orders){
|
||||
foreach ($orders as $order) {
|
||||
$shop = $shops->where('id',$order['shop_id'])->first();
|
||||
$shop = Shop::query()->find($order['shop_id']);
|
||||
if(!empty($shop)){
|
||||
BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->queryStatusAndSync($order);
|
||||
usleep(10);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,11 +33,16 @@ class MiaoXuan extends BusinessClient
|
||||
{
|
||||
}
|
||||
|
||||
public function downloadAfterSaleOrdersAndSave($beginTime, $endTime, $page = 1){
|
||||
public function downloadAfterSaleOrdersAndSave($beginTime, $endTime, $page = 1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function queryStatusAndSync($order){
|
||||
public function queryStatusAndSync($order)
|
||||
{
|
||||
$appendParams = ["order_sn" => $order->order_sn, "type" => "erpQuery"];
|
||||
$url = 'http://shop.chutang66.com/miaoxuan/queryStatus';
|
||||
$res = $this->formDataPostRequest($url, $appendParams);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ class GoodSkuService
|
||||
->select("external_sku_id", DB::raw("SUM(goods_number) - SUM(already_cancel_number) as number"))
|
||||
->whereIn("external_sku_id", $externalSkuIds)
|
||||
->where("b.shipping_status", "=", BusinessOrderShippingStatus::UNSHIP)
|
||||
->where("business_order_items.created_at", ">=", $startTime)->where("b.cancel_status", "=", 0)
|
||||
->where("business_order_items.created_at", ">=", $startTime)->where("business_order_items.cancel_status", "=", 0)
|
||||
->groupBy('external_sku_id')->get()->toArray();
|
||||
|
||||
Log::info("盘点未发货数据",[$unshippedDataCollect]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user