Commit 2c581ba3 by 杨树贤

修改同步范围

parent 0e015fc6
Showing with 4 additions and 2 deletions
...@@ -664,9 +664,11 @@ class DataService ...@@ -664,9 +664,11 @@ class DataService
public function reSyncSupplierToErp() public function reSyncSupplierToErp()
{ {
// $suppliers = SupplierChannelModel::select(['supplier_id','supplier_name'])->where('is_type', 0)->get()->toArray(); ini_set('memory_limit', -1);
$suppliers = \DB::connection('web')->select('SELECT a.* FROM lie_supplier_channel a INNER JOIN (SELECT supplier_name FROM lie_supplier_channel GROUP BY supplier_name HAVING COUNT(supplier_id) > 1) b ON a.supplier_name = b.supplier_name ORDER BY supplier_name DESC'); $suppliers = SupplierChannelModel::select(['supplier_id', 'supplier_name'])->where('is_type', 0)
->where('status', 2)->get()->toArray();
foreach ($suppliers as $supplier) { foreach ($suppliers as $supplier) {
usleep(100000);
if (!empty($supplier['supplier_name'])) { if (!empty($supplier['supplier_name'])) {
echo "同步供应商到金蝶 : " . $supplier['supplier_name'] . PHP_EOL; echo "同步供应商到金蝶 : " . $supplier['supplier_name'] . PHP_EOL;
(new SyncSupplierService())->syncSupplierToErp($supplier['supplier_id']); (new SyncSupplierService())->syncSupplierToErp($supplier['supplier_id']);
......
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