<?php
declare(strict_types=1);

namespace app\common\model;

use think\Model;

class ScanLog Extends Model
{
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    protected $type = [
        'createtime'     =>  'timestamp:Y-m-d H:i',
        'updatetime'     =>  'timestamp:Y-m-d H:i',
    ];

    // 关联已识别到的单号记录
    public function worker()
    {
        return $this->hasOne(Worker::class,'tracking_number','code')->field('express_company,product_name,labor_cost');
    }
}
