最新版本

This commit is contained in:
2026-05-26 09:44:21 +08:00
parent 822ed9a099
commit fa41edf857
24 changed files with 597 additions and 163 deletions

View File

@@ -9,4 +9,20 @@ class Companys extends Model
{
protected $table = 'companys';
public function companyoperators()
{
return $this->hasMany(CompanyOperators::class, 'company_id', 'id');
}
public static function customDelete($id)
{
$companyAndOperators = self::with(['companyoperators'])->where('id', $id)->find();
if (!$companyAndOperators) {
return false;
}
$companyAndOperators->companyoperators()->delete();
$companyAndOperators->delete();
return true;
}
}