فهرست منبع

删除一些过期的日志标记
删除一些for update场景

Zhouzhendong 4 سال پیش
والد
کامیت
a7df60c1c1

+ 0 - 3
app/Console/Commands/SyncWMSOrderTask.php

@@ -9,7 +9,6 @@ use App\ValueStore;
 use Carbon\Carbon;
 use Illuminate\Console\Command;
 use Illuminate\Support\Facades\Cache;
-use Illuminate\Support\Facades\Log;
 
 class SyncWMSOrderTask extends Command
 {
@@ -62,13 +61,11 @@ class SyncWMSOrderTask extends Command
         $start = (string)$start;
         Cache::put($this->last_start_key,$start);
         ValueStore::query()->where('name',$this->last_start_key)->update(['value'=>$start]);
-        Log::info("订单同步开始时间",['date' => $start]);
         $this->syncCreatedOrder();
         $this->syncUpdatedOrder();
         $end = (string)Carbon::now();
         Cache::put($this->last_end_key,$end);
         ValueStore::query()->where('name',$this->last_end_key)->update(['value'=>$end]);
-        Log::info("订单同步结束时间",['date' => $end]);
     }
 
     public function syncCreatedOrder()

+ 1 - 1
app/Http/Controllers/StorageController.php

@@ -287,7 +287,7 @@ SQL;
                     $modelMap[$model->id] = $model->commodity->maximum;
                 }
                 $orderBy.= " END";
-                $boxes = MaterialBox::query()->whereIn("code",$codes)->orderByRaw($orderBy)->lockForUpdate()->get();
+                $boxes = MaterialBox::query()->whereIn("code",$codes)->orderByRaw($orderBy)->get();
                 //筛选下海柔可用箱
                 list($codes,$notCodes) = app("MaterialBoxService")->checkHaiQ(array_column($boxes->toArray(),"code"));
                 if (!$codes)$boxes = new \Illuminate\Database\Eloquent\Collection();

+ 0 - 1
app/Jobs/LaborApplyRecordJob.php

@@ -38,7 +38,6 @@ class LaborApplyRecordJob implements ShouldQueue
      */
     public function handle()
     {
-        Log::debug("LaborApplyRecordJob isAppend = " . ($this->isAppend + 1) . "");
         $response = $this->service->allocationLaborToLaborCompany($this->isAppend);
         if (!$response['success']) throw new WarningException($response['error_message']);
     }

+ 1 - 1
app/Services/OwnerAreaReportService.php

@@ -60,7 +60,7 @@ class OwnerAreaReportService
         $area = $this->query(OwnerAreaReport::query(),$params)->with("ownerStoragePriceModel")->lockForUpdate()->first();
         try{
             if ($values["accounting_area"] ?? null && $area->accounting_area != $values["accounting_area"]){
-                $report = OwnerBillReport::query()->lockForUpdate()->where("owner_id",$area->owner_id)
+                $report = OwnerBillReport::query()->where("owner_id",$area->owner_id)
                     ->where("counting_month",'like',$area->counting_month."%")->first();
                 if ($report){
                     if (!$area->ownerStoragePriceModel)return false;

+ 1 - 1
app/Services/OwnerPriceOperationService.php

@@ -259,7 +259,7 @@ class OwnerPriceOperationService
             DB::beginTransaction();
             //此处暂时未使用cache的互斥锁 使用sql行锁代替下 防止缓存击穿
             $pivot = app(CacheService::class)->getOrExecute($key,function ()use($key,$targetValue,&$sign,$rule,$owner){
-                return DB::selectOne(DB::raw("SELECT * FROM owner_price_operation_owner WHERE owner_price_operation_id = ? AND owner_id = ? for update"),[$rule->id,$owner]);
+                return DB::selectOne(DB::raw("SELECT * FROM owner_price_operation_owner WHERE owner_price_operation_id = ? AND owner_id = ? "),[$rule->id,$owner]);
             },1000);
             if ($pivot && (!$pivot->discount_date || substr($pivot->discount_date,0,7)!=$month || $pivot->target_value < $targetValue)){
                 //未被标记过处理时间或处理时间不为本月,或上次处理值过期,处理历史即时账单