Compare commits
No commits in common. "8247f78cf41704ef4779b06b47876ecaecd5d508" and "6bcee28d8fce42e7e84be8b4919cb6dd71b885d2" have entirely different histories.
8247f78cf4
...
6bcee28d8f
|
|
@ -74,10 +74,6 @@ class SoilMonitoringLogFixCommand extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($log->isDirty()) {
|
|
||||||
$log->is_filled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$log->save();
|
$log->save();
|
||||||
|
|
||||||
if ($log->wasChanged()) {
|
if ($log->wasChanged()) {
|
||||||
|
|
|
||||||
|
|
@ -74,10 +74,6 @@ class WaterQualityMonitoringLogFixCommand extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($log->isDirty()) {
|
|
||||||
$log->is_filled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$log->save();
|
$log->save();
|
||||||
|
|
||||||
if ($log->wasChanged()) {
|
if ($log->wasChanged()) {
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,8 @@ class SoilMonitoringLog extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $attributes = [
|
|
||||||
'is_filled' => false,
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'monitored_at' => 'datetime',
|
'monitored_at' => 'datetime',
|
||||||
'is_filled' => 'bool',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|
@ -28,6 +23,5 @@ class SoilMonitoringLog extends Model
|
||||||
'p',
|
'p',
|
||||||
'k',
|
'k',
|
||||||
'monitored_at',
|
'monitored_at',
|
||||||
'is_filled',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,8 @@ class WaterQualityMonitoringLog extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $attributes = [
|
|
||||||
'is_filled' => false,
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'monitored_at' => 'datetime',
|
'monitored_at' => 'datetime',
|
||||||
'is_filled' => 'bool',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
|
@ -28,6 +23,5 @@ class WaterQualityMonitoringLog extends Model
|
||||||
'temperature',
|
'temperature',
|
||||||
'turbidity',
|
'turbidity',
|
||||||
'monitored_at',
|
'monitored_at',
|
||||||
'is_filled',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
<?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']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
<?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