12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace app\jobs\product;
- use app\services\product\product\StoreProductRelationServices;
- use crmeb\basic\BaseJobs;
- use crmeb\traits\QueueTrait;
- class ProductRelationJob extends BaseJobs
- {
- use QueueTrait;
-
- public function doJob(int $id, array $relation_id, int $type = 1, int $is_show = 1)
- {
- try {
-
- $storeProductRelationServices = app()->make(StoreProductRelationServices::class);
-
- $storeProductRelationServices->saveRelation($id, $relation_id, $type, $is_show);
- } catch (\Throwable $e) {
- response_log_write([
- 'message' => '写入商品关联[type:' . $type . ']发生错误,错误原因:' . $e->getMessage(),
- 'file' => $e->getFile(),
- 'line' => $e->getLine()
- ]);
- }
- return true;
- }
- }
|