Commit 9068cece by 杨树贤

fix

parent d9bda88f
......@@ -35,7 +35,7 @@ LIEXIN_DB_USERNAME=liexin
LIEXIN_DB_PASSWORD=liexin#zsyM
//自营基石数据库
DB_SELF_HOST=192.168.1.235
DB_SELF_HOST=192.168.1.234
DB_SELF_DATABASE=liexin_data
DB_SELF_USERNAME=spu
DB_SELF_PASSWORD=spu
......@@ -49,14 +49,14 @@ DB_PASSWORD_YUNXIN=liexin_yunxin#zsyM
DB_YUNXIN_PORT=3306
//联营sku数据库01
DB_SKU_HOST=192.168.1.235
DB_SKU_HOST=192.168.1.234
DB_SKU_DATABASE=liexin_sku_1
DB_SKU_USERNAME=spu
DB_SKU_PASSWORD=spu
DB_SKU_PORT=3306
//联营SPU数据库
DB_SPU_HOST=192.168.1.235
DB_SPU_HOST=192.168.1.234
DB_SPU_DATABASE=liexin_spu
DB_SPU_USERNAME=spu
DB_SPU_PASSWORD=spu
......@@ -66,11 +66,11 @@ CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=redis
REDIS_HOST=192.168.1.235
REDIS_HOST=192.168.1.234
REDIS_PASSWORD=icDb29mLy2s
REDIS_PORT=6379
REDIS_USER_HOST=192.168.1.235
REDIS_USER_HOST=192.168.1.234
REDIS_USER_PASSWORD=icDb29mLy2s
REDIS_USER_PORT=6379
......
......@@ -70,13 +70,15 @@ class SkuApiController extends Controller
// $endTime = $updateTime[1];
// }
$uploadLogId = SkuUploadLogModel::where('supplier_code',$supplierCode)
->where('status',SkuUploadLogModel::STATUS_HANDLED)->value('id');
$uploadLogId = SkuUploadLogModel::where('supplier_code', $supplierCode)
->where('status', SkuUploadLogModel::STATUS_HANDLED)->orderBy('id', 'desc')
->value('id');
$data = [
'supplier_code' => $supplierCode,
'brand_id' => $brandId,
'upload_log_id' => $uploadLogId,
'log_id' => $uploadLogId,
"down_type" => 1,
];
//改成队列
(new SkuService())->batchOffShelfSkuQueue($data);
......
......@@ -158,11 +158,11 @@ class SkuService
config('database.connections.rabbitmq.login'),
config('database.connections.rabbitmq.password'));
$channel = $conn->channel();
$channel->queue_declare('test_batch_update_goods_status', false, true, false, false);
$channel->queue_declare('lie_footstone_batch_downsku_queue', false, true, false, false);
$msg = new AMQPMessage(json_encode($data),
array('content_type' => 'text/plain'));
$channel->basic_publish($msg, '', 'test_batch_update_goods_status');
$channel->basic_publish($msg, '', 'lie_footstone_batch_downsku_queue');
}
//批量更新sku状态,走队列的
......@@ -174,6 +174,7 @@ class SkuService
//上架
$queueData = [];
if ($data['operate_type'] == self::OPERATE_TYPE_PUTAWAY) {
$queueName = 'lie_batch_upsku_queue';
$data['cp_time'] = $data['is_long_term'] == 1 ? self::LONG_TERM_TIMESTAMP : strtotime($data['cp_time']);
foreach ($skuIds as $skuId) {
$queueData[] = [
......@@ -182,10 +183,11 @@ class SkuService
];
}
} else {
$queueName = 'lie_batch_downsku_queue';
$queueData['down_type'] = 2;
$queueData['data'] = $skuIds;
}
QueueService::publishQueue('test_update_goods_status', $queueData);
QueueService::publishQueue($queueName, $queueData);
} catch (\Exception $exception) {
return $exception;
}
......
......@@ -12,6 +12,8 @@
*/
use App\Http\Services\SkuService;
Route::group(['middleware' => ['web', 'menu']], function () {
Route::get('/', 'WebController@Entrance');
Route::match(['get', 'post'], '/web/{key}', 'WebController@Entrance');
......@@ -51,6 +53,11 @@ Route::group(['middleware' => ['external'],'namespace' => 'Api'], function () {
});
Route::match(['get', 'post'], '/test', function () {
$service = new \App\Http\Services\DataService();
$service->transferPayType(true);
$data = [
'sku_ids'=> '1163833791883548099,1163833787833091377',
'is_long_term' => -1,
'operate_type' => 1,
'cp_time' => '2022-05-31 0:0:0',
];
(new SkuService())->batchUpdateSkuStatus($data);
});
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