BomItemMatchExtendModel.php
712 Bytes
<?php
namespace App\Model\Bom;
class BomItemMatchExtendModel extends BomItemMatchBaseModel{
protected $connection = 'bom'; //库名
protected $table = 'bom_match_extend'; //库名
protected $primaryKey = 'id'; //设置id
protected $guarded = ['id']; //设置字段黑名单
public $timestamps = true;
const CREATED_AT = 'create_time';
const UPDATED_AT = null;
protected $dateFormat = 'Y-m-d H:i:s';
public function fromDateTime($value){
return strtotime(parent::fromDateTime($value));
}
public function get_bom_match_extend($bom_id,$matching_id){
return static::where(["bom_id"=>$bom_id,"matching_id"=>$matching_id])->first();
}
}