<?php
namespace app\model;
//评论表
class Comment extends Base
{

    public const state_default         = 0;// 待审核
    public const state_success         = 1;// 3审核通过
    public const state_hide            = 2;// 2隐藏

    public const type_text            = 0;// 文本
    public const type_img             = 1;//  图片
    public const type_voice           = 2;// 语音

    public const msg_type_text         = "text";// 普通文字
    public const msg_type_emoji        = "emoji";// emoji标签




    public static  function allState(){
        return [
            self::state_default=>"待审核",
            self::state_success=>"审核通过",
            self::state_hide=>"隐藏",
        ];
    }

    public static  function allType(){
        return [
            self::type_text=>"文本",
            self::type_img=>"图片",
            self::type_voice=>"语音",
        ];
    }
    public function account()
    {
        return $this->hasOne(Account::class,"user_code","user_code");
    }
    public function business()
    {
        return $this->hasOne(Business::class,"code","business_code");
    }
}