<?php

namespace app\api\model;
use think\Db;
use think\Model;
class EthnographyArticle extends Model
{

    // 表名
    protected $name = 'ethnography_article';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'status_text'
    ];


    /**
     * 查看我发布的族志
     */
    public static function getMySendByFamilyLog($map=[],$rows=15,$pages=[]){

        $array = self::where($map)->orderRaw('rand()')->paginate(
            empty($rows)?null:$rows,    //每页显示几条记录
            empty($pages[0])?false:$pages[0],
            empty($pages[1])?['query'=>input('get.')]:$pages[1]
        );

        return $array;
    }



}