15090180611 dd354eaca0 多样青春活动版:
配合前端对接核销流程作接口微调

分离式后台基础接口:
权限管理-权限组管理增删改查接口
2025-04-21 18:24:02 +08:00

47 lines
966 B
PHP

<?php
namespace app\adminapi\model;
use app\common\model\BaseModel;
use think\Model;
class AuthGroup extends BaseModel
{
protected $name = 'api_auth_group';
// 开启自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
public function getNameAttr($value, $data)
{
return __($value);
}
/** 通用详情(后台api版本)
* @param $params
* @param $trans
* @return $this
* @throws \Exception
*/
public function detail($id,$show_field=[],$except_field=[]){
$row = $this->get($id);
if (!$row) {
throw new \Exception(__('No Results were found'));
}
if($show_field){
$row->visible($show_field);
}
if($except_field){
$row->hidden($except_field);
}
return $row;
}
}