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.
nt_backend/application/common/model/ProjectMaterialTemplate.php

31 lines
716 B

1 year ago
<?php
namespace app\common\model;
use think\Model;
class ProjectMaterialTemplate extends Model
{
// 表名
protected $name = 'project_material_template';
// 开启自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
protected $resultSetType = 'collection';
public static function getList() {
$return = self::field('id,name,material_ids')->select();
$_data = [];
foreach ($return as $key => $value) {
$_data[]= [
'id' => $value['id'],
'name' => $value['name'],
'temp_config' => ProjectMaterial::getInfoByIds($value['material_ids'])
];
}
return $_data;
}
}