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
789e9b60
authored
Nov 18, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营业时间
parent
5535da69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
app/Admin/Controllers/PharmacyController.php
+8
-4
database/migrations/2024_11_18_114538_add_business_to_pharmacy_table.php
+30
-0
No files found.
app/Admin/Controllers/PharmacyController.php
View file @
789e9b60
...
...
@@ -38,7 +38,12 @@ protected function grid()
// $grid->column('pre_packaged_food')->image('', 50, 50);
$grid
->
column
(
'area'
);
$grid
->
column
(
'address'
);
$grid
->
column
(
'business_hours'
);
$grid
->
column
(
'营业时间'
)
->
display
(
function
()
{
$start
=
\Carbon\Carbon
::
parse
(
$this
->
business_start
)
->
format
(
'H:i'
);
$end
=
\Carbon\Carbon
::
parse
(
$this
->
business_end
)
->
format
(
'H:i'
);
return
$start
.
'~'
.
$end
;
});
$grid
->
column
(
'mobile'
);
// $grid->column('lng');
// $grid->column('lat');
...
...
@@ -85,7 +90,6 @@ protected function detail($id)
$show
->
field
(
'area'
)
->
width
(
4
);
$show
->
field
(
'address'
)
->
width
(
4
);
$show
->
field
(
'mobile'
)
->
width
(
4
);
$show
->
field
(
'business_hours'
)
->
width
(
4
);
$show
->
field
(
'lng'
)
->
width
(
4
);
$show
->
field
(
'lat'
)
->
width
(
4
);
$show
->
field
(
'status'
)
->
width
(
4
);
...
...
@@ -117,8 +121,8 @@ protected function form()
$form
->
text
(
'area'
)
->
width
(
4
);
$form
->
text
(
'address'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
)
->
required
()
->
help
(
'药店登录账号'
);
$form
->
t
ext
(
'business_hours'
)
->
width
(
4
);
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
);
$form
->
t
imeRange
(
'business_start'
,
'business_end'
,
'营业时间'
)
->
required
(
);
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
)
->
width
(
4
)
;
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
)
->
help
(
'实际后台操作可以不用关联'
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
switch
(
'is_open'
)
->
width
(
4
);
...
...
database/migrations/2024_11_18_114538_add_business_to_pharmacy_table.php
0 → 100644
View file @
789e9b60
<?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
->
time
(
'business_start'
)
->
comment
(
'营业开始时间'
);
$table
->
time
(
'business_end'
)
->
comment
(
'营业结束时间'
);
$table
->
dropColumn
(
'business_hours'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'pharmacy'
,
function
(
Blueprint
$table
)
{
//
});
}
};
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