<?php
namespace app\common\model;
use think\Model;

// 引入框架内置类
use think\facade\Db;
use think\facade\Event;
use think\facade\Session;
use think\facade\Request;

class Common extends Model{
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

	//获取单个字段值 $id|cate_id $field|获取字段
    public static function CateContent($id,$field){
		//$value=Db::name('CateContent')->where('cate_id',$id)->value($field);
		$info = Cate::alias('a')->join('cate_content c', 'a.id=c.cate_id', 'left')->field('a.*,c.*')->find($id)->toArray();

		return $info[$field];
	}
	
}