Update
parent
6bcee28d8f
commit
0b4f1394af
|
|
@ -74,6 +74,10 @@ class SoilMonitoringLogFixCommand extends Command
|
|||
}
|
||||
}
|
||||
|
||||
if ($log->isDirty()) {
|
||||
$log->is_filled = true;
|
||||
}
|
||||
|
||||
$log->save();
|
||||
|
||||
if ($log->wasChanged()) {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@ class WaterQualityMonitoringLogFixCommand extends Command
|
|||
}
|
||||
}
|
||||
|
||||
if ($log->isDirty()) {
|
||||
$log->is_filled = true;
|
||||
}
|
||||
|
||||
$log->save();
|
||||
|
||||
if ($log->wasChanged()) {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,14 @@ class MeteorologicalMonitoringLog extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $attributes = [
|
||||
'is_filled' => false,
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'wind_direction' => WindDirection::class,
|
||||
'monitored_at' => 'datetime',
|
||||
'is_filled' => 'bool',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
|
|
|||
|
|
@ -9,8 +9,13 @@ class SoilMonitoringLog extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $attributes = [
|
||||
'is_filled' => false,
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'monitored_at' => 'datetime',
|
||||
'is_filled' => 'bool',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
|
|
@ -23,5 +28,6 @@ class SoilMonitoringLog extends Model
|
|||
'p',
|
||||
'k',
|
||||
'monitored_at',
|
||||
'is_filled',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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->boolean('is_filled')->default(false)->comment('是否是填充数据');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('soil_monitoring_logs', function (Blueprint $table) {
|
||||
$table->dropColumn(['is_filled']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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('water_quality_monitoring_logs', function (Blueprint $table) {
|
||||
$table->boolean('is_filled')->default(false)->comment('是否是填充数据');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('water_quality_monitoring_logs', function (Blueprint $table) {
|
||||
$table->dropColumn(['is_filled']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue