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
8afefc2f
authored
Dec 30, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加药店医保开方控制
parent
c295f45d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
1 deletions
+65
-1
app/Admin/Controllers/PharmacyController.php
+2
-1
app/Api/Controllers/SiteConfigController.php
+20
-0
app/Models/PharmacyModel.php
+13
-0
database/migrations/2024_12_30_095015_add_yb_open_to_pharmacy.php
+28
-0
routes/api.php
+2
-0
No files found.
app/Admin/Controllers/PharmacyController.php
View file @
8afefc2f
...
...
@@ -49,6 +49,7 @@ protected function grid()
}
$grid
->
column
(
'is_open'
)
->
using
(
PharmacyModel
::
IS_OPEN_MAP
)
->
help
(
'药店控制'
)
->
dot
(
PharmacyModel
::
IS_OPEN_MAP_COLOR
);
$grid
->
column
(
'is_auto'
)
->
using
(
PharmacyModel
::
IS_AUTO_MAP
)
->
dot
(
PharmacyModel
::
IS_AUTO_MAP_COLOR
);
$grid
->
column
(
'is_yb_open'
,
'医保开方'
)
->
using
(
PharmacyModel
::
IS_YB_OPEN_MAP
)
->
dot
(
PharmacyModel
::
IS_AUTO_MAP_COLOR
);
$grid
->
column
(
'name'
);
$grid
->
column
(
'药师数量'
)
->
display
(
function
()
{
$num
=
PharmacistModel
::
where
(
'pharmacy_id'
,
$this
->
id
)
->
count
();
...
...
@@ -181,7 +182,7 @@ protected function form()
$form
->
switch
(
'status'
);
}
$form
->
switch
(
'is_auto'
);
$form
->
switch
(
'is_yb_open'
,
'医保开方'
);
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
});
...
...
app/Api/Controllers/SiteConfigController.php
View file @
8afefc2f
...
...
@@ -3,6 +3,8 @@
namespace
App\Api\Controllers
;
use
App\Http\Controllers\BaseApiController
;
use
App\Models\PharmacyModel
;
use
App\Models\User
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Log
;
...
...
@@ -32,4 +34,22 @@ public function config(Request $request)
return
$this
->
success
(
$data
);
}
public
function
isYBOpen
(
Request
$request
)
{
$is_open_yb
=
0
;
$authInfo
=
auth
(
'api'
)
->
user
();
if
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_PHARMACY
){
$pharmacy
=
PharmacyModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
if
(
$pharmacy
)
{
$is_open_yb
=
$pharmacy
->
is_yb_open
;
}
}
$data
=
[
'is_open_yb'
=>
$is_open_yb
,
];
return
$this
->
success
(
$data
);
}
}
app/Models/PharmacyModel.php
View file @
8afefc2f
...
...
@@ -61,6 +61,19 @@ class PharmacyModel extends Model
self
::
IS_AUTO_TRUE
=>
'success'
,
];
// 开启医保开方[0=否,1=是]
const
IS_YB_OPEN_FALSE
=
0
;
const
IS_YB_OPEN_TRUE
=
1
;
// 是否问题是否通用通用-文字映射
const
IS_YB_OPEN_MAP
=
[
self
::
IS_YB_OPEN_FALSE
=>
'否'
,
self
::
IS_YB_OPEN_TRUE
=>
'是'
,
];
// 药店所属于的用户,一对一
public
function
user
()
{
...
...
database/migrations/2024_12_30_095015_add_yb_open_to_pharmacy.php
0 → 100644
View file @
8afefc2f
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
$table
->
tinyInteger
(
'is_yb_open'
)
->
default
(
0
)
->
comment
(
'开启医保开方[0=否,1=是]'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
//
});
}
};
routes/api.php
View file @
8afefc2f
...
...
@@ -125,4 +125,6 @@
Route
::
post
(
'/pharmacist-delete'
,
'App\Api\Controllers\PharmacistController@delete'
);
# 获取系统配置
Route
::
post
(
'/config'
,
'App\Api\Controllers\SiteConfigController@config'
);
# 获取是否开启医保按钮配置
Route
::
post
(
'/is-yb-open'
,
'App\Api\Controllers\SiteConfigController@isYBOpen'
);
});
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