feat : sts

This commit is contained in:
2025-05-27 15:03:53 +08:00
parent acaa606423
commit 922fc16a52

View File

@@ -120,15 +120,16 @@ class RankTask
->select([
'admin_user.id',
'chef.kitchen_id',
'admin_user.city_id'
]);
})
->get();
if ($chefInfo->isEmpty()) throw new Exception(__CLASS__.'数据生成失败,获取厨师信息失败');
$this->chefInfo = $chefInfo->toArray();
$kitchenIds = array_column($this->chefInfo, 'kitchen_id');
$this->kitchenSiteList = $this->kitchenModel->whereIn('id',$kitchenIds)->pluck('city_id','id')->toArray();
if (empty($this->kitchenSiteList)) throw new Exception(__CLASS__.'数据生成失败,获取厨房城市信息失败');
// $kitchenIds = array_column($this->chefInfo, 'kitchen_id');
// $this->kitchenSiteList = $this->kitchenModel->whereIn('id',$kitchenIds)->pluck('city_id','id')->toArray();
// if (empty($this->kitchenSiteList)) throw new Exception(__CLASS__.'数据生成失败,获取厨房城市信息失败');
$this->buildChefEvaluationRankData();
@@ -165,7 +166,7 @@ class RankTask
$this->insertData[] = [
'chef_id' => $v->id,
'kitchen_id' => $v->kitchen_id,
'city_id' => $this->kitchenSiteList[$v->kitchen_id] ?? 0,
'city_id' => $v->city_id,
'time_key' => $this->thisWeekInfo['year'].$this->thisWeekInfo['week_number'],
'board_type' => LeaderboardHistoryCode::TYPE_CHEF_SALE,
'score' => $data[$v->id] ?? 0,
@@ -181,7 +182,7 @@ class RankTask
$this->insertData[] = [
'chef_id' => $v->id,
'kitchen_id' => $v->kitchen_id,
'city_id' => $this->kitchenSiteList[$v->kitchen_id] ?? 0,
'city_id' => $v->city_id,
'time_key' => $this->thisWeekInfo['year'].$this->thisWeekInfo['week_number'],
'board_type' => $type,
'score' => 0,
@@ -208,7 +209,7 @@ class RankTask
$this->insertData[] = [
'chef_id' => $v->id,
'kitchen_id' => $v->kitchen_id,
'city_id' => $this->kitchenSiteList[$v->kitchen_id] ?? 0,
'city_id' => $v->city_id,
'time_key' => $this->thisWeekInfo['year'].$this->thisWeekInfo['week_number'],
'board_type' => LeaderboardHistoryCode::TYPE_CHEF_SCORE,
'score' => $data[$v->id] ?? 0,