develop
parent
5811fdfb0e
commit
0d735f631a
|
|
@ -5,6 +5,9 @@ namespace App\Models;
|
|||
use EloquentFilter\Filterable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* 收获记录
|
||||
*/
|
||||
class PlantHarvestLog extends Model
|
||||
{
|
||||
use Filterable;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace App\Services\Admin;
|
|||
|
||||
use App\Models\RegionPlantLog;
|
||||
use App\Filters\Admin\RegionPlantLogFilter;
|
||||
use App\Models\PlantHarvestLog;
|
||||
|
||||
/**
|
||||
* @method RegionPlantLog getModel()
|
||||
|
|
@ -15,4 +16,12 @@ class CropPlantService extends BaseService
|
|||
|
||||
protected string $modelFilterName = RegionPlantLogFilter::class;
|
||||
|
||||
public function delete(string $ids): mixed
|
||||
{
|
||||
$id = explode(',', $ids);
|
||||
// 同时删除收获记录
|
||||
PlantHarvestLog::whereIn('plant_id', $id)->delete();
|
||||
|
||||
return $this->query()->whereIn($this->primaryKey(), $id)->delete();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue