仓库初始化

This commit is contained in:
2025-08-13 10:43:56 +08:00
commit e8f9b46680
5180 changed files with 859303 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
public function {%methodName%}($value, $data)
{
$value = $value ?: ($data['{%field%}'] ?? '');
$valueArr = explode(',', $value);
$list = $this->{%listMethodName%}();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}

View File

@@ -0,0 +1,6 @@
public function {%methodName%}($value, $data)
{
$value = $value ?: ($data['{%field%}'] ?? '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
public function import()
{
parent::import();
}

View File

@@ -0,0 +1,10 @@
protected static function init()
{
self::afterInsert(function ($row) {
if (!$row['{%order%}']) {
$pk = $row->getPk();
$row->getQuery()->where($pk, $row[$pk])->update(['{%order%}' => $row[$pk]]);
}
});
}

View File

@@ -0,0 +1,5 @@
public function {%relationMethod%}s()
{
return $this->{%relationMode%}('{%relationClassName%}', '{%relationForeignKey%}', '{%relationPrimaryKey%}');
}

View File

@@ -0,0 +1,5 @@
public function {%relationMethod%}()
{
return $this->{%relationMode%}('{%relationClassName%}', '{%relationForeignKey%}', '{%relationPrimaryKey%}', [], 'LEFT')->setEagerlyType(0);
}

View File

@@ -0,0 +1,8 @@
public function {%methodName%}($value, $data)
{
$value = $value ?: ($data['{%field%}'] ?? '');
$valueArr = explode(',', $value);
$list = $this->{%listMethodName%}();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}

View File

@@ -0,0 +1,7 @@
public function {%methodName%}($value, $data)
{
$value = $value ?: ($data['{%field%}'] ?? '');
$list = $this->{%listMethodName%}();
return $list[$value] ?? '';
}

View File

@@ -0,0 +1,60 @@
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: '{%controllerUrl%}/recyclebin' + location.search,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},{%recyclebinTitleJs%}
{
field: '{%deleteTimeField%}',
title: __('Deletetime'),
operate: 'RANGE',
addclass: 'datetimerange',
formatter: Table.api.formatter.datetime
},
{
field: 'operate',
width: '140px',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'Restore',
text: __('Restore'),
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: '{%controllerUrl%}/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: '{%controllerUrl%}/destroy',
refresh: true
}
],
formatter: Table.api.formatter.operate
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},

View File

@@ -0,0 +1,7 @@
public function {%methodName%}($value, $data)
{
$value = $value ?: ($data['{%field%}'] ?? '');
$list = $this->{%listMethodName%}();
return $list[$value] ?? '';
}