Commit a7203e5e by 杨树贤

导出需要下架商品的供应商

parent 1fea53c3
......@@ -1117,7 +1117,7 @@ class DataService
//供应商性质为“分销平台”的有上传过sku的供应商
$excelData = [];
$uploadedSkuSuppliers = SupplierChannelModel::where('supplier_group', 5)
->where('is_type', 0)->where('uploaded_sku',1)->get()->toArray();
->where('is_type', 0)->where('uploaded_sku', 1)->get()->toArray();
foreach ($uploadedSkuSuppliers as $supplier) {
$supplier = SupplierChannelModel::where('supplier_code', $supplier['supplier_code'])->first();
if (empty($supplier)) {
......@@ -1140,4 +1140,21 @@ class DataService
});
})->store('csv');
}
//获取非原厂,非api对接的,有sku的正式供应商列表
public function getOffShelfSupplierList()
{
$suppliers = SupplierChannelModel::where('sku_num', '>', 0)->where('supplier_group','!=',4)
->where('is_type', 0)->get()->toArray();
$supplierList = [];
foreach ($suppliers as $supplier) {
$isApiSupplier = DataManageModel::where('canal', $supplier['supplier_code'])->where('is_type', 0)->exist();
if ($isApiSupplier) {
continue;
}
$supplierList[] = $supplier['code'];
}
echo json_encode($supplierList);
}
}
\ No newline at end of file
......@@ -67,7 +67,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\DataService())->exportSupplierBySourceType();
(new \App\Http\Services\DataService())->getOffShelfSupplierList();
// \App\Model\SupplierChannelModel::where('supplier_name', '深圳市金开盛电子有限公司')->update([
// 'status' => 2,
// 'update_time' => time(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment