Blogger Information
Blog 2
fans 1
comment 0
visits 4201
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
tp6获取器
杨敏的博客
Original
2569 people have browsed it

Controller源代码

<?php

namespace app\index\controller;

use app\BaseController;
use app\index\model\Admins;

class Index extends BaseController
{
    public function index()
    {
        $db = new Admins();
        $index = $db->index();
        print_r($index->status);
    }
}

Model源代码

<?php

namespace app\index\model;

use think\Model;

class Admins extends Model
{

    public function index()
    {
        $select=Admins::find(1);
        return $select;
    }
    public function getStatusAttr($value)
    {
        $status = [1=>'禁用',0=>'正常'];
        return $status[$value];
    }

}


Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post