<?php

namespace app\common\model;

use think\Model;

class AgentMarket extends Model
{
    // 设置字段信息
    protected $schema = [
        'id'         => 'int',
        'agent_id'   => 'int',
        'name'       => 'string',
        'mobile'     => 'string',
        'content'    => 'string',
        'is_bargain' => 'int',
    ];

    public function getIsBargainTextAttr($value, $data)
    {
        $is_bargain = [1 => '是', 2 => '否'];
        return $is_bargain[$data['is_bargain']];
    }
}