You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
user_center/app/Http/Resources/AuthRule.php

30 lines
773 B

<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class AuthRule extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
$status_txts = [0 => '删除', 1 => '启用', 2 => '关闭'];
return [
'id' => $this->id,
'name' => $this->name,
'method' => $this->method,
'title' => $this->title,
'group' => $this->group,
'module' => $this->module,
'condition' => $this->condition,
'status' => $this->status,
'status_txt' => $status_txts[$this->status]
];
}
}