mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-01 23:40:38 +00:00
Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev
This commit is contained in:
commit
81b3f9a14a
@ -69,6 +69,7 @@ class SystemCrud extends AuthController
|
||||
['pid', 0],
|
||||
['menuName', ''],
|
||||
['tableName', ''],
|
||||
['modelName', ''],
|
||||
['tableComment', ''],//表备注
|
||||
['tableField', []],//表字段
|
||||
['tableIndex', []],//索引
|
||||
@ -206,6 +207,7 @@ class SystemCrud extends AuthController
|
||||
|
||||
$make = $this->services->makeFile($info->table_name, $routeName, false, [
|
||||
'menuName' => $info->name,
|
||||
'modelName' => $info->model_name,
|
||||
'key' => $key,
|
||||
'softDelete' => $softDelete,
|
||||
'fromField' => $info->field['fromField'] ?? [],
|
||||
@ -411,18 +413,24 @@ class SystemCrud extends AuthController
|
||||
}
|
||||
}
|
||||
|
||||
$columns = [];
|
||||
$columns = [
|
||||
[
|
||||
'title' => 'ID',
|
||||
'key' => $key,
|
||||
'from_type' => '',
|
||||
]
|
||||
];
|
||||
foreach ((array)$info->field['tableField'] as $item) {
|
||||
if (isset($item['from_type']) && $item['from_type']) {
|
||||
if (isset($item['is_table']) && $item['is_table']) {
|
||||
$columns[] = [
|
||||
'title' => $item['table_name'],
|
||||
'title' => $item['table_name'] ?: $item['comment'],
|
||||
'key' => $item['field'],
|
||||
'from_type' => $item['from_type'],
|
||||
];
|
||||
}
|
||||
}
|
||||
$routeList = $newRoute;
|
||||
return app('json')->success(compact('key', 'routeList', 'columns'));
|
||||
$route = $newRoute;
|
||||
return app('json')->success(compact('key', 'route', 'columns'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -52,7 +52,9 @@ class SystemCrudServices extends BaseServices
|
||||
'system_crud', 'wechat_key', 'user_label_relation', 'user_brokerage_frozen',
|
||||
'user_brokerage', 'store_product_cate', 'store_bargain_user_help', 'shipping_templates_region',
|
||||
'shipping_templates_no_delivery', 'shipping_templates_free', 'other_order_status', 'lang_code',
|
||||
'lang_country', 'app_version',
|
||||
'lang_country', 'app_version', 'user', 'wechat_user', 'template_message', 'store_order', 'other_order',
|
||||
'store_order_cart_info', 'store_order_economize', 'store_order_invoice', 'store_order_refund',
|
||||
'store_order_status', 'store_pink'
|
||||
];
|
||||
|
||||
/**
|
||||
@ -73,7 +75,7 @@ class SystemCrudServices extends BaseServices
|
||||
public function getList()
|
||||
{
|
||||
[$page, $limit] = $this->getPageValue();
|
||||
$list = $this->dao->selectList([], 'add_time,id,name,table_name,table_comment,table_comment', $page, $limit, 'id desc');
|
||||
$list = $this->dao->selectList([], 'add_time,id,name,table_name,table_comment,table_collation', $page, $limit, 'id desc');
|
||||
$count = $this->dao->count();
|
||||
|
||||
return compact('list', 'count');
|
||||
@ -378,6 +380,7 @@ class SystemCrudServices extends BaseServices
|
||||
$res = $this->dao->save([
|
||||
'pid' => $data['pid'],
|
||||
'name' => $data['menuName'],
|
||||
'model_name' => $data['modelName'],
|
||||
'table_name' => $tableName,
|
||||
'table_comment' => $tableInfo['TABLE_COMMENT'] ?? '',
|
||||
'table_collation' => $tableInfo['TABLE_COLLATION'] ?? '',
|
||||
@ -529,6 +532,7 @@ class SystemCrudServices extends BaseServices
|
||||
$service->setFilePathName($filePath['service'] ?? '')->setbasePath($basePath)->handle($tableName, [
|
||||
'field' => $options['fromField'],
|
||||
'usePath' => $dao->getUsePath(),
|
||||
'modelName' => $options['modelName'] ?? '',
|
||||
]);
|
||||
//生成验证器
|
||||
$validate = app()->make(Validate::class);
|
||||
|
||||
@ -47,6 +47,7 @@ class Service extends Make
|
||||
$path = $options['path'] ?? '';
|
||||
|
||||
$this->value['use-php'] = $this->getDaoClassName($name, $path);
|
||||
$this->value['modelName'] = $options['modelName'] ?? $name;
|
||||
|
||||
$action = $options['action'] ?? [];
|
||||
$field = $options['field'] ?? [];
|
||||
@ -63,7 +64,7 @@ class Service extends Make
|
||||
|
||||
//生成form表单
|
||||
if (in_array('save', $action) || in_array('update', $action)) {
|
||||
$var = ['{%date%}', '{%route%}', '{%form-php%}', '{%menus%}'];
|
||||
$var = ['{%date%}', '{%route%}', '{%form-php%}', '{%modelName%}'];
|
||||
$value = [$this->value['date'], Str::snake($options['route'] ?? $name)];
|
||||
$from = [];
|
||||
foreach ($field as $item) {
|
||||
@ -86,7 +87,7 @@ class Service extends Make
|
||||
} else {
|
||||
$value[] = '';
|
||||
}
|
||||
$value[] = $options['menus'] ?? $name;
|
||||
$value[] = $options['modelName'] ?? $options['menus'] ?? $name;
|
||||
|
||||
if ($value && $var) {
|
||||
$contentAction = str_replace($var, $value, $contentAction);
|
||||
|
||||
@ -23,6 +23,7 @@ use think\exception\ValidateException;
|
||||
{%use-php%}
|
||||
|
||||
/**
|
||||
* {%modelName%}
|
||||
* Class CrudService
|
||||
* @date {%date%}
|
||||
* @package app\services\crud{%path%}
|
||||
|
||||
@ -19,5 +19,5 @@
|
||||
|
||||
{%form-php%}
|
||||
|
||||
return create_form('{%menus%}', $rule, $url, $id ? 'PUT' : 'POST');
|
||||
return create_form('{%modelName%}', $rule, $url, $id ? 'PUT' : 'POST');
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ Route::miss(function () {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'index.html');
|
||||
default:
|
||||
if (!request()->isMobile()) {
|
||||
if (is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('type')) {
|
||||
if (is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('mdType')) {
|
||||
return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html');
|
||||
} else {
|
||||
if (request()->get('type')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user