You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.1 KiB

<?php
namespace app\admin\model\ykjp\sell;
use think\Model;
use traits\model\SoftDelete;
class Product extends Model {
use SoftDelete;
// 表名
protected $name = 'ykjp_sell_product';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
];
public function products() {
return $this->belongsTo('app\admin\model\ykjp\product\Product', 'product_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function sells() {
return $this->belongsTo('app\admin\model\ykjp\sell\Sell', 'sell_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function object_array($array) {
if (is_object($array)) {
$array = (array) $array;
} if (is_array($array)) {
foreach ($array as $key => $value) {
$array[$key] = $this->object_array($value);
}
}
return $array;
}
}