Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca9bb49e
authored
Dec 01, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加全局配置
parent
e0705467
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
4 deletions
+48
-4
app/Admin/Extensions/Form/SiteConfigForm.php
+4
-1
app/Api/Controllers/SiteConfigController.php
+38
-0
database/migrations/2024_11_10_233001_create_prescription_table.php
+2
-2
routes/api.php
+4
-1
No files found.
app/Admin/Extensions/Form/SiteConfigForm.php
View file @
ca9bb49e
...
@@ -37,9 +37,12 @@ public function form()
...
@@ -37,9 +37,12 @@ public function form()
$form
->
width
(
4
)
->
time
(
'prescription_period_end'
,
'截止'
)
->
format
(
'HH:mm'
)
->
rules
(
'required_if:prescription_period_status,1'
)
->
setLabelClass
([
'asterisk'
])
->
default
((
$data
[
'prescription_period_end'
]
??
''
));
$form
->
width
(
4
)
->
time
(
'prescription_period_end'
,
'截止'
)
->
format
(
'HH:mm'
)
->
rules
(
'required_if:prescription_period_status,1'
)
->
setLabelClass
([
'asterisk'
])
->
default
((
$data
[
'prescription_period_end'
]
??
''
));
})
->
default
((
$data
[
'prescription_period_status'
]
??
0
));
})
->
default
((
$data
[
'prescription_period_status'
]
??
0
));
$this
->
number
(
'prescription_limit_buy_7'
,
'7日内限购(全局)'
)
->
required
()
->
default
((
$data
[
'prescription_limit_buy_7'
]
??
0
))
->
min
(
0
);
$this
->
number
(
'prescription_limit_buy_7'
,
'1日内限购(全局)'
)
->
required
()
->
default
((
$data
[
'prescription_limit_buy_7'
]
??
1
))
->
min
(
1
)
->
max
(
10
)
->
help
(
'最多可设置10'
);
$this
->
number
(
'diagnosis_limit'
,
'选择诊断数限制'
)
->
required
()
->
default
((
$data
[
'diagnosis_limit'
]
??
1
))
->
min
(
1
)
->
max
(
5
)
->
help
(
'诊断数选择设置1-5'
);
$this
->
number
(
'drug_choose_limit'
,
'选择药品限制'
)
->
required
()
->
default
((
$data
[
'drug_choose_limit'
]
??
5
))
->
min
(
1
)
->
max
(
5
)
->
help
(
'药品目录选择数,最多可设置5'
);
// $this->switch('prescription_auto', '医师自动开方')->default(($data['prescription_auto'] ?? 0));
// $this->switch('prescription_auto', '医师自动开方')->default(($data['prescription_auto'] ?? 0));
$this
->
text
(
'limit_keywords'
,
'限制关键词'
)
->
default
(
$data
[
'limit_keywords'
]
??
''
)
->
required
()
->
help
(
'多个关键词请用英文逗号分隔'
);
$this
->
disableResetButton
();
$this
->
disableResetButton
();
}
}
...
...
app/Api/Controllers/SiteConfigController.php
0 → 100644
View file @
ca9bb49e
<?php
namespace
App\Api\Controllers
;
use
App\Http\Controllers\BaseApiController
;
use
App\Models\DoctorModel
;
use
App\Models\PharmacyModel
;
use
App\Models\User
;
use
App\Services\SmsService
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Log
;
use
Overtrue\EasySms\EasySms
;
class
SiteConfigController
extends
BaseApiController
{
public
function
test
(){
$site_config
=
admin_setting_array
(
'site_config'
);
Log
::
info
(
'测试'
,
$site_config
);
$data
=
[
'diagnosis_limit'
=>
$site_config
[
'diagnosis_limit'
],
'drug_choose_limit'
=>
$site_config
[
'drug_choose_limit'
],
];
return
$this
->
success
(
$data
);
}
public
function
config
(
Request
$request
)
{
$site_config
=
admin_setting_array
(
'site_config'
);
# Log::info('测试', $site_config);
$data
=
[
'diagnosis_limit'
=>
$site_config
[
'diagnosis_limit'
],
'drug_choose_limit'
=>
$site_config
[
'drug_choose_limit'
],
];
return
$this
->
success
(
$data
);
}
}
\ No newline at end of file
database/migrations/2024_11_10_233001_create_prescription_table.php
View file @
ca9bb49e
...
@@ -24,8 +24,8 @@ public function up(): void
...
@@ -24,8 +24,8 @@ public function up(): void
$table
->
string
(
'patient_name'
,
32
)
->
comment
(
'问诊人姓名'
);
$table
->
string
(
'patient_name'
,
32
)
->
comment
(
'问诊人姓名'
);
$table
->
integer
(
'patient_age'
)
->
default
(
0
)
->
comment
(
'问诊人年龄'
);
$table
->
integer
(
'patient_age'
)
->
default
(
0
)
->
comment
(
'问诊人年龄'
);
$table
->
tinyInteger
(
'patient_gender'
)
->
default
(
0
)
->
comment
(
'问诊人性别。[1=男性,2=女性,0=未知]'
);
$table
->
tinyInteger
(
'patient_gender'
)
->
default
(
0
)
->
comment
(
'问诊人性别。[1=男性,2=女性,0=未知]'
);
$table
->
bigInteger
(
'diagnosis_id'
)
->
default
(
0
)
->
comment
(
'诊断表ID'
);
$table
->
string
(
'diagnosis_id'
,
255
)
->
nullable
(
)
->
comment
(
'诊断表ID'
);
$table
->
string
(
'diagnosis_name'
,
128
)
->
nullable
()
->
comment
(
'诊断'
);
$table
->
string
(
'diagnosis_name'
,
255
)
->
nullable
()
->
comment
(
'诊断'
);
$table
->
text
(
'inquiry_info'
)
->
comment
(
'问诊问题'
);
$table
->
text
(
'inquiry_info'
)
->
comment
(
'问诊问题'
);
$table
->
boolean
(
'is_abnormal'
)
->
default
(
0
)
->
comment
(
'是否异常处方[0=否,1=是]'
);
$table
->
boolean
(
'is_abnormal'
)
->
default
(
0
)
->
comment
(
'是否异常处方[0=否,1=是]'
);
...
...
routes/api.php
View file @
ca9bb49e
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
// 不需要登录的组
// 不需要登录的组
// 小程序静默登录
// 小程序静默登录
Route
::
post
(
'login'
,
'App\Api\Controllers\UserController@login'
);
Route
::
post
(
'login'
,
'App\Api\Controllers\UserController@login'
);
Route
::
get
(
'test'
,
'App\Api\Controllers\
Dru
gController@test'
);
Route
::
get
(
'test'
,
'App\Api\Controllers\
SiteConfi
gController@test'
);
...
@@ -110,4 +110,6 @@
...
@@ -110,4 +110,6 @@
Route
::
post
(
'/pharmacist-upload'
,
'App\Api\Controllers\PharmacistController@upload'
);
Route
::
post
(
'/pharmacist-upload'
,
'App\Api\Controllers\PharmacistController@upload'
);
# 药师删除
# 药师删除
Route
::
post
(
'/pharmacist-delete'
,
'App\Api\Controllers\PharmacistController@delete'
);
Route
::
post
(
'/pharmacist-delete'
,
'App\Api\Controllers\PharmacistController@delete'
);
# 获取系统配置
Route
::
post
(
'/config'
,
'App\Api\Controllers\SiteConfigController@config'
);
});
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment