Zone.php
505 字节
<?php
namespace App\Models\Channel;
use Illuminate\Database\Eloquent\Model;
/**
* Class Zone
* @package App\Models
* @author zbj
* @date 2023/6/27
*/
class Zone extends Model
{
//设置关联表名
protected $table = 'gl_channel_zone';
public static function sync($title){
$zone = self::where('title', $title)->first();
if(!$zone){
$zone = new self();
$zone->title = $title;
$zone->save();
}
return $zone;
}
}