添加筛选基地根据产业筛选
parent
ae07d3b3bd
commit
b59a317b17
|
|
@ -20,4 +20,8 @@ class AgriculturalBaseFilter extends ModelFilter
|
||||||
{
|
{
|
||||||
return $this->where('name', 'like', '%'.$name.'%');
|
return $this->where('name', 'like', '%'.$name.'%');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function industry($industry){
|
||||||
|
return $this->where('industry_key', $industry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ class AgriculturalBase extends Model
|
||||||
'parent_id', 'cultivated',
|
'parent_id', 'cultivated',
|
||||||
'sort',
|
'sort',
|
||||||
'extends',
|
'extends',
|
||||||
|
'industry_key',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function parent(){
|
public function parent(){
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?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->string('industry_key')->nullable()->comment('产业类型');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('agricultural_bases', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->dropColumn('industry_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue