土壤设备增加酸碱度
parent
5ce52144b3
commit
dfe788d7ea
|
|
@ -518,6 +518,21 @@ class DeviceController extends Controller
|
||||||
'p',
|
'p',
|
||||||
'k',
|
'k',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
switch ($device->supplier_key) {
|
||||||
|
case 'device-supplier-biang':
|
||||||
|
$fields = [
|
||||||
|
'conductivity',
|
||||||
|
'humidity',
|
||||||
|
'temperature',
|
||||||
|
'n',
|
||||||
|
'p',
|
||||||
|
'k',
|
||||||
|
'ph',
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/** @var \Illuminate\Support\Collection */
|
/** @var \Illuminate\Support\Collection */
|
||||||
$monitoringLogs = (
|
$monitoringLogs = (
|
||||||
$isSameDay
|
$isSameDay
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ class SoilMonitoringDailyLog extends Model
|
||||||
'n',
|
'n',
|
||||||
'p',
|
'p',
|
||||||
'k',
|
'k',
|
||||||
|
'ph',
|
||||||
'moisture',
|
'moisture',
|
||||||
'monitored_at',
|
'monitored_at',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ class SoilMonitoringLog extends Model
|
||||||
'n',
|
'n',
|
||||||
'p',
|
'p',
|
||||||
'k',
|
'k',
|
||||||
|
'ph',
|
||||||
'monitored_at',
|
'monitored_at',
|
||||||
'moisture',
|
'moisture',
|
||||||
'is_filled',
|
'is_filled',
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ class BiAngDeviceService
|
||||||
'soilConductivity' => 'conductivity',
|
'soilConductivity' => 'conductivity',
|
||||||
'soilTemperature' => 'temperature',
|
'soilTemperature' => 'temperature',
|
||||||
'soilMoisture' => 'humidity',
|
'soilMoisture' => 'humidity',
|
||||||
|
'soilPH' => 'ph',
|
||||||
default => null,
|
default => null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -418,6 +419,7 @@ class BiAngDeviceService
|
||||||
'temperature' => ['sum' => 0, 'count' => 0],
|
'temperature' => ['sum' => 0, 'count' => 0],
|
||||||
'humidity' => ['sum' => 0, 'count' => 0],
|
'humidity' => ['sum' => 0, 'count' => 0],
|
||||||
'moisture' => ['sum' => 0, 'count' => 0],
|
'moisture' => ['sum' => 0, 'count' => 0],
|
||||||
|
'ph' => ['sum' => 0, 'count' => 0],
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($soilReports as $soilReport) {
|
foreach ($soilReports as $soilReport) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('soil_monitoring_logs', function (Blueprint $table) {
|
||||||
|
$table->decimal('ph', 4, 2)->nullable()->comment('酸碱度');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('soil_monitoring_logs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['ph']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('soil_monitoring_daily_logs', function (Blueprint $table) {
|
||||||
|
$table->decimal('ph', 4, 2)->nullable()->comment('酸碱度');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('soil_monitoring_daily_logs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn(['ph']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue