|
|
@@ -1053,7 +1053,7 @@ class DeviceWorkService extends Service
|
|
|
$ruleSet = DB::table('rule_set_details as rd')
|
|
|
->join('rule_set as r', 'r.id', '=', 'rd.main_id')
|
|
|
->where('r.month', $monthStart)
|
|
|
- ->where('rd.type', 2) // 设备类型
|
|
|
+ ->where('rd.type', RuleSetDetails::type_two) // 设备类型
|
|
|
->where('r.del_time', 0)
|
|
|
->where('rd.del_time', 0)
|
|
|
->select('rd.*')
|
|
|
@@ -1063,7 +1063,7 @@ class DeviceWorkService extends Service
|
|
|
$usedItemIds = $ruleSet->pluck('item_id')->unique()->toArray();
|
|
|
$itemMap = DB::table('item')
|
|
|
->whereIn('id', $usedItemIds)
|
|
|
- ->pluck('title', 'id') // 这里的 title 对应你之前的需求
|
|
|
+ ->pluck('title', 'id')
|
|
|
->toArray();
|
|
|
|
|
|
$ruleSetGrouped = $ruleSet->groupBy('data_id'); // 按 device_id 分组
|