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
b004237f
authored
Dec 01, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://git.imohe.com/zhaozengyu/tzt-admin
into develop
parents
26906dd7
66d8a0d4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
5 deletions
+60
-5
app/Api/Controllers/DrugController.php
+2
-2
app/Api/Controllers/PatientController.php
+15
-0
app/Console/Commands/TestCommand.php
+41
-0
config/app.php
+1
-0
routes/api.php
+1
-3
No files found.
app/Api/Controllers/DrugController.php
View file @
b004237f
...
...
@@ -115,12 +115,12 @@ public function drugLimit(Request $request)
$patient_id
=
$request
->
input
(
'patient_id'
);
$pharmacy_id
=
$request
->
input
(
'pharmacy_id'
);
#
$sevenDaysAgo = Carbon::now()->subDays(7);
//
$sevenDaysAgo = Carbon::now()->subDays(7);
$oneDayAgo
=
Carbon
::
now
()
->
subDay
();
$prescriptions
=
PrescriptionModel
::
where
(
'patient_id'
,
$patient_id
)
->
where
(
'is_voided'
,
PrescriptionModel
::
IS_VOIDED_FALSE
)
// 未作废的处方
->
where
(
'status'
,
PrescriptionModel
::
PRESCRIPTION_STATUS_SUCCESS
)
#
->where('pharmacy_id', $pharmacy_id)
//
->where('pharmacy_id', $pharmacy_id)
->
where
(
'created_at'
,
'>='
,
$oneDayAgo
)
->
get
();
...
...
app/Api/Controllers/PatientController.php
View file @
b004237f
...
...
@@ -9,6 +9,7 @@
use
App\Models\User
;
use
Illuminate\Http\Request
;
use
Jxlwqq\IdValidator\IdValidator
;
use
Milon\Barcode\DNS2D
;
// 问诊人控制器
class
PatientController
extends
BaseApiController
...
...
@@ -186,4 +187,18 @@ public function getDefault(Request $request)
return
$this
->
failed
(
'暂无默认问诊人'
);
}
}
// 获取二维码
public
function
getQrCode
(
Request
$request
)
{
$scene
=
$request
->
input
(
'scene'
);
if
(
!
$scene
)
{
return
$this
->
failed
(
'请传入参数scene~'
);
}
$dns2d
=
new
DNS2D
();
$base64Img
=
'data:image/jpg;base64,'
.
$dns2d
->
getBarcodePNG
(
$scene
,
'QRCODE'
,
200
,
200
);
// return "<img src={$base64Img} >";
return
$this
->
success
(
$base64Img
);
}
}
app/Console/Commands/TestCommand.php
0 → 100644
View file @
b004237f
<?php
namespace
App\Console\Commands
;
use
App\Models\InquiryModel
;
use
App\Models\PrescriptionModel
;
use
Illuminate\Console\Command
;
class
TestCommand
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'mohe:test'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'测试命令'
;
/**
* Execute the console command.
*/
public
function
handle
()
{
// 刷新问诊问题
$prescriptions
=
PrescriptionModel
::
all
();
foreach
(
$prescriptions
as
$prescription
)
{
$inquiry_info
=
$prescription
->
inquiry_info
;
foreach
(
$inquiry_info
as
&
$v
)
{
$v
[
'question'
]
=
InquiryModel
::
find
(
$v
[
'inquiry_id'
])
->
question
;
}
$prescription
->
inquiry_info
=
$inquiry_info
;
$prescription
->
save
();
}
}
}
config/app.php
View file @
b004237f
...
...
@@ -170,6 +170,7 @@
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider
::
class
,
App\Providers\RouteServiceProvider
::
class
,
Milon\Barcode\BarcodeServiceProvider
::
class
,
])
->
toArray
(),
/*
...
...
routes/api.php
View file @
b004237f
...
...
@@ -22,9 +22,7 @@
// 小程序静默登录
Route
::
post
(
'login'
,
'App\Api\Controllers\UserController@login'
);
Route
::
get
(
'test'
,
'App\Api\Controllers\SiteConfigController@test'
);
Route
::
get
(
'qrcode'
,
'App\Api\Controllers\PatientController@getQrCode'
);
// 需要验证是否登录的路由组
Route
::
middleware
([
'jwt.auth'
,
'checkrole'
])
->
group
(
function
()
{
...
...
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