blog/app/model/RoleMenu.php

25 lines
675 B
PHP
Raw Normal View History

2024-06-08 15:54:41 +08:00
<?php
namespace app\model;
use think\Model;
class RoleMenu extends Model
{
protected $table = 'eb_role_menu';
protected $primaryKey = 'id';
public $timestamps = false;
public function saveData(array $param):array
{
$info = $this->saveAll($param);
if ($info) return show(true, '保存成功');
return show(false, '保存失败,请重试');
}
public function delByRoleId(int $roleId):array
{
$info = $this->where('role_id', $roleId)->where('delete_time', 0)->update(['delete_time' => time()]);
if ($info) return show(true, '保存成功');
return show(false, '保存失败,请重试');
}
}