Compare commits
No commits in common. "135218ff545790259ac3754ef1bd4a2290bf6e0a" and "05537c035f41e7ee2f59a7995f546c15d7916ff1" have entirely different histories.
135218ff54
...
05537c035f
10
README.md
10
README.md
|
|
@ -1,13 +1,3 @@
|
||||||
# lcly-data-admin
|
# lcly-data-admin
|
||||||
|
|
||||||
隆昌农业大数据
|
隆昌农业大数据
|
||||||
|
|
||||||
php artisan k:g
|
|
||||||
|
|
||||||
php artisan admin:install
|
|
||||||
|
|
||||||
php artisan db:seed AdminSeeder
|
|
||||||
php artisan db:seed PermissionSeeder
|
|
||||||
php artisan db:seed AgriculturalBaseSeeder
|
|
||||||
php artisan db:seed CropSeeder
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class AgriculturalBaseRequest extends FormRequest
|
||||||
'address_lat' => 'nullable|regex:/^\d+(\.\d{1,10})?$/',
|
'address_lat' => 'nullable|regex:/^\d+(\.\d{1,10})?$/',
|
||||||
'address_lng' => 'nullable|regex:/^\d+(\.\d{1,10})?$/',
|
'address_lng' => 'nullable|regex:/^\d+(\.\d{1,10})?$/',
|
||||||
'parent_id' => 'required_if:type,1|integer|min:0',
|
'parent_id' => 'required_if:type,1|integer|min:0',
|
||||||
'sort' => 'nullable|integer|min:0',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ class AgriculturalBase extends Model
|
||||||
'name', 'person', 'address', 'address_lat', 'address_lng',
|
'name', 'person', 'address', 'address_lat', 'address_lng',
|
||||||
'description', 'map', 'areas', 'workforce',
|
'description', 'map', 'areas', 'workforce',
|
||||||
'parent_id', 'cultivated',
|
'parent_id', 'cultivated',
|
||||||
'sort',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
public function parent(){
|
public function parent(){
|
||||||
|
|
@ -39,7 +38,7 @@ class AgriculturalBase extends Model
|
||||||
|
|
||||||
public function scopeSort($q)
|
public function scopeSort($q)
|
||||||
{
|
{
|
||||||
return $q->orderBy('sort', 'desc')->orderBy('created_at', 'desc');
|
return $q->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function crops()
|
public function crops()
|
||||||
|
|
|
||||||
|
|
@ -1,34 +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('agricultural_bases', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
$table->unsignedInteger('sort')->default(0)->comment('排序');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('agricultural_bases', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
$table->dropColumn(['sort']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -143,13 +143,6 @@ class CropSeeder extends Seeder
|
||||||
['name'=>'不知火','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
['name'=>'不知火','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
||||||
['name'=>'耙耙柑','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
['name'=>'耙耙柑','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
||||||
['name'=>'爱媛','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
['name'=>'爱媛','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
||||||
['name'=>'稻虾','category_id' => 3, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
['name'=>'生猪','category_id' => 4, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
['name'=>'水稻','category_id' => 2, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
['name'=>'活草鱼','category_id' => 3, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
['name'=>'鲈鱼','category_id' => 3, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
['name'=>'乌鱼','category_id' => 3, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
['name'=>'鱼类','category_id' => 3, 'crop_type' => 1, 'unit' => '吨'],
|
|
||||||
];
|
];
|
||||||
DB::table('crops')->truncate();
|
DB::table('crops')->truncate();
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue