<?php

namespace App\Models;

use App\Models\BaseModel;

/**
 * @description 通话纪录
 * @author  system;
 * @version    1.0
 * @date 2018-11-27 03:15:47
 *
 */
class CallRecordsModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'call_records';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
        'phone',
        'start_time',
        'end_time',
        'record_path',
        'hangup_dispostion',
        'ip',
        'term_status',
        'intention',
        'cdr_id',
        'call_id',
        'tag'
    ];

    /***
     * 通话详情
     * @return mixed
     */
    public function process()
    {
        return CallRecordsProcessModel::where('call_id', $this->call_id)->where('ip', $this->ip)->get();
    }

}