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.
41 lines
1.1 KiB
41 lines
1.1 KiB
<?php
|
|
|
|
namespace app\admin\model\ykjp\sell;
|
|
|
|
use think\Model;
|
|
use traits\model\SoftDelete;
|
|
|
|
class deliveryPro extends Model {
|
|
|
|
// use SoftDelete;
|
|
// 表名
|
|
protected $name = 'ykjp_delivery_product';
|
|
// 自动写入时间戳字段
|
|
protected $autoWriteTimestamp = 'int';
|
|
// 定义时间戳字段名
|
|
protected $createTime = 'createtime';
|
|
protected $updateTime = 'updatetime';
|
|
// 追加属性
|
|
protected $append = [
|
|
];
|
|
|
|
public function products() {
|
|
return $this->belongsTo('app\admin\model\ykjp\product\Product', 'product_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
|
}
|
|
|
|
public function delivery() {
|
|
return $this->belongsTo('app\admin\model\ykjp\sell\Delivery', 'delivery_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;
|
|
}
|
|
|
|
}
|
|
|