50 lines
1.3 KiB
PHP
Raw Normal View History

<?php
namespace App\Services\Business\MiaoXuan;
use App\Models\BusinessGoodsSku;
use App\Models\GoodsSku;
use App\Models\Log;
use App\Services\Business\BusinessClient;
class MiaoXuan extends BusinessClient
{
public function auth()
{
// TODO: Implement auth() method.
}
public function downloadGoodsAndBind()
{
}
public function incrQuantity($skuId)
{
$goodsSku = GoodsSku::query()->find($skuId);
$business = BusinessGoodsSku::query()->where('shop_id', $this->shop->id)->where('self_sku_id', $skuId)->first(['goods_id', 'sku_id', 'external_sku_id'])->toArray();
$appendParams = Goods::incrQuantity($this->shop->id, $goodsSku->stock, $business);
$this->formDataPostRequest($type, $appendParams);
$log = new Log();
$log->module = 'plat';
$log->action = 'POST';
$log->target_type = 'miaoxuan';
$log->target_id = 0;
$log->target_field = '更新库存';
$log->user_id = 1;
$log->message = 'success';
$log->save();
}
public function downloadOrders($beginTime, $endTime, $activityNo, $downloadType = 'default')
{
Order::saveOrders($beginTime, $endTime, $activityNo);
}
public function bindGoods($goods)
{
Goods::bindGoods($goods, $this->shop->id);
}
}