Commit 47a9a88e by 杨树贤

同步供应商银行信息

parent 67ece528
......@@ -8,6 +8,7 @@ use App\Model\RedisModel;
use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use App\Model\SupplierReceiptModel;
use App\Model\SupplierSyncModel;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
......@@ -78,6 +79,21 @@ class SyncSupplierService
if (!empty($supplier['currency'])) {
$message['currencyNumber'] = array_get(config('sync.SyncCurrencyType'), $supplier['currency']);
}
//银行信息
$receipts = SupplierReceiptModel::where('supplier_id', $supplierId)
->where('bank_name', '!=', '')->where('account_no', '!=', '')->get()->toArray();
if (!empty($receipts)) {
$message['bankinfo'] = [];
foreach ($receipts as $receipt) {
$message['bankinfo'][] = [
"bank" => $receipt['bank_adderss'],
'bankaccount' => $receipt['account_no'],
];
}
}
//dd($message);
$conn = new AMQPStreamConnection(config('database.connections.rabbitmq.host'),
config('database.connections.rabbitmq.port'),
config('database.connections.rabbitmq.login'),
......@@ -194,4 +210,4 @@ class SyncSupplierService
}
}
}
\ No newline at end of file
}
......@@ -82,7 +82,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
Route::match(['get', 'post'], '/test', function () {
(new \App\Http\Services\DataService())->initCouponTime();
(new \App\Http\Services\SyncSupplierService())->syncSupplierToErp(12405);
// $data = [
// 'supplier_code' => 'L0015420',
// 'brand_id' => 0,
......
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