<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "clue".
 *
 * @property int $id 自增ID
 * @property string $clue_id 平台线索ID
 * @property string|null $req_id 请求ID
 * @property int|null $local_account_id 本地商户ID
 * @property string|null $advertiser_name 广告主名称
 * @property string|null $promotion_id 推广计划ID
 * @property string|null $promotion_name 推广计划名称
 * @property string|null $action_type 行为类型
 * @property int|null $ad_type 广告类型
 * @property string|null $video_id 视频ID
 * @property string|null $content_id 内容ID
 * @property string|null $title_id 标题ID
 * @property string|null $name 姓名
 * @property string|null $telephone 手机号
 * @property string|null $weixin 微信
 * @property string|null $gender 性别
 * @property int|null $age 年龄
 * @property string|null $province_name
 * @property string|null $city_name
 * @property string|null $county_name
 * @property string|null $address
 * @property string|null $auto_province_name 系统识别省
 * @property string|null $auto_city_name 系统识别市
 * @property string|null $country_name
 * @property string|null $author_aweme_id
 * @property string|null $author_nickname
 * @property string|null $author_role
 * @property string|null $staff_aweme_id
 * @property string|null $staff_nickname
 * @property string|null $allocation_status 分配状态
 * @property int|null $convert_status 是否转化
 * @property string|null $clue_type 线索类型
 * @property string|null $clue_return_status 线索回传状态
 * @property int|null $effective_state 是否有效
 * @property string|null $effective_state_name
 * @property string|null $follow_state_name
 * @property string|null $is_private_clue
 * @property string|null $remark 备注
 * @property string|null $remark_dict 问答/聊天记录
 * @property string|null $system_tags 系统标签
 * @property string|null $tags 自定义标签
 * @property string|null $create_time_detail 线索创建时间
 * @property string|null $modify_time 平台更新时间
 * @property int|null $created_at
 * @property int|null $updated_at
 * @property string|null $note
 * @property int|null $is_virtual
 */
class Clue extends \app\models\BaseModel
{


    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'clue';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['req_id', 'local_account_id', 'advertiser_name', 'promotion_id', 'promotion_name', 'action_type', 'ad_type', 'video_id', 'content_id', 'title_id', 'name', 'telephone', 'weixin', 'gender', 'province_name', 'city_name', 'county_name', 'address', 'auto_province_name', 'auto_city_name', 'country_name', 'author_aweme_id', 'author_nickname', 'author_role', 'staff_aweme_id', 'staff_nickname', 'allocation_status', 'clue_type', 'clue_return_status', 'effective_state_name', 'follow_state_name', 'remark', 'remark_dict', 'system_tags', 'tags', 'create_time_detail', 'modify_time', 'note'], 'default', 'value' => null],
            [['is_virtual'], 'default', 'value' => 0],
            [['is_private_clue'], 'default', 'value' => 'NO'],
            [['clue_id'], 'required'],
            [['local_account_id', 'ad_type', 'age', 'convert_status', 'effective_state', 'created_at', 'updated_at', 'is_virtual'], 'integer'],
            [['remark', 'remark_dict', 'system_tags', 'tags', 'note'], 'string'],
            [['create_time_detail', 'modify_time'], 'safe'],
            [['clue_id', 'action_type', 'content_id', 'author_aweme_id', 'staff_aweme_id'], 'string', 'max' => 32],
            [['req_id'], 'string', 'max' => 64],
            [['advertiser_name', 'promotion_id', 'promotion_name', 'video_id', 'title_id', 'is_private_clue'], 'string', 'max' => 100],
            [['name', 'weixin', 'province_name', 'city_name', 'county_name', 'auto_province_name', 'auto_city_name', 'country_name', 'author_nickname', 'staff_nickname'], 'string', 'max' => 50],
            [['telephone', 'author_role', 'allocation_status', 'clue_type', 'clue_return_status', 'effective_state_name', 'follow_state_name'], 'string', 'max' => 20],
            [['gender'], 'string', 'max' => 16],
            [['address'], 'string', 'max' => 255],
            [['clue_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => '自增ID',
            'clue_id' => '平台线索ID',
            'req_id' => '请求ID',
            'local_account_id' => '本地商户ID',
            'advertiser_name' => '广告主名称',
            'promotion_id' => '推广计划ID',
            'promotion_name' => '推广计划名称',
            'action_type' => '行为类型',
            'ad_type' => '广告类型',
            'video_id' => '视频ID',
            'content_id' => '内容ID',
            'title_id' => '标题ID',
            'name' => '姓名',
            'telephone' => '手机号',
            'weixin' => '微信',
            'gender' => '性别',
            'age' => '年龄',
            'province_name' => 'Province Name',
            'city_name' => 'City Name',
            'county_name' => 'County Name',
            'address' => 'Address',
            'auto_province_name' => '系统识别省',
            'auto_city_name' => '系统识别市',
            'country_name' => 'Country Name',
            'author_aweme_id' => 'Author Aweme ID',
            'author_nickname' => 'Author Nickname',
            'author_role' => 'Author Role',
            'staff_aweme_id' => 'Staff Aweme ID',
            'staff_nickname' => 'Staff Nickname',
            'allocation_status' => '分配状态',
            'convert_status' => '是否转化',
            'clue_type' => '线索类型',
            'clue_return_status' => '线索回传状态',
            'effective_state' => '是否有效',
            'effective_state_name' => 'Effective State Name',
            'follow_state_name' => 'Follow State Name',
            'is_private_clue' => 'Is Private Clue',
            'remark' => '备注',
            'remark_dict' => '问答/聊天记录',
            'system_tags' => '系统标签',
            'tags' => '自定义标签',
            'create_time_detail' => '线索创建时间',
            'modify_time' => '平台更新时间',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'note' => 'Note',
            'is_virtual' => 'Is Virtual',
        ];
    }

}
