Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
goods
Commits
cf520fa1
Commit
cf520fa1
authored
Jun 23, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:set
parent
e2dcf593
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
50 deletions
+18
-50
SubShop.php
application/models/shop/mysql/SubShop.php
+1
-1
ShopService.php
application/services/shop/ShopService.php
+17
-17
SubShopService.php
application/services/shop/SubShopService.php
+0
-32
No files found.
application/models/shop/mysql/SubShop.php
View file @
cf520fa1
...
...
@@ -10,7 +10,7 @@ class SubShop extends MysqlBase
{
const
TABLE_NAME
=
'sub_shop'
;
const
CONFIG_INDEX
=
'goods'
;
const
PRIMARY_KEY
=
's
tores
_id'
;
const
PRIMARY_KEY
=
's
ub_shop
_id'
;
public
static
function
getRecord
(
$where
,
$colums
=
[])
...
...
application/services/shop/ShopService.php
View file @
cf520fa1
...
...
@@ -21,15 +21,15 @@ class ShopService
*/
public
static
function
addShop
(
$params
)
{
$life
_account_i
d
=
!
empty
(
$params
[
'life_account_id'
])
?
$params
[
'life_account_id'
]
:
''
;
$life
AccountI
d
=
!
empty
(
$params
[
'life_account_id'
])
?
$params
[
'life_account_id'
]
:
''
;
$phone
=
!
empty
(
$params
[
'phone'
])
?
$params
[
'phone'
]
:
''
;
$shop
_i
d
=
!
empty
(
$params
[
'shop_id'
])
?
$params
[
'shop_id'
]
:
''
;
$shop
I
d
=
!
empty
(
$params
[
'shop_id'
])
?
$params
[
'shop_id'
]
:
''
;
$name
=
!
empty
(
$params
[
'name'
])
?
$params
[
'name'
]
:
''
;
$address
_l
ng
=
!
empty
(
$params
[
'address_lng'
])
?
$params
[
'address_lng'
]
:
''
;
$address
_l
at
=
!
empty
(
$params
[
'address_lat'
])
?
$params
[
'address_lat'
]
:
''
;
$address
L
ng
=
!
empty
(
$params
[
'address_lng'
])
?
$params
[
'address_lng'
]
:
''
;
$address
L
at
=
!
empty
(
$params
[
'address_lat'
])
?
$params
[
'address_lat'
]
:
''
;
$address
=
!
empty
(
$params
[
'address'
])
?
$params
[
'address'
]
:
''
;
if
(
empty
(
$life
_account_i
d
))
{
if
(
empty
(
$life
AccountI
d
))
{
throw
new
ShopException
([
'cus'
=>
0
]);
}
...
...
@@ -70,14 +70,14 @@ class ShopService
throw
new
ShopException
([
'cus'
=>
7
]);
}
$res
=
self
::
getIdgenId
(
1
,
'goods'
,
$count
=
1
);
$s
tores_i
d
=
!
empty
(
$res
[
0
])
?
$res
[
0
]
:
''
;
$s
ubShopI
d
=
!
empty
(
$res
[
0
])
?
$res
[
0
]
:
''
;
$colums
=
[
's
tores_id'
=>
$stores_i
d
,
'life_account_id'
=>
$life
_account_i
d
,
'shop_id'
=>
$shop
_i
d
,
's
ub_shop_id'
=>
$subShopI
d
,
'life_account_id'
=>
$life
AccountI
d
,
'shop_id'
=>
$shop
I
d
,
'name'
=>
$name
,
'address_lng'
=>
$address
_l
ng
,
'address_lat'
=>
$address
_l
at
,
'address_lng'
=>
$address
L
ng
,
'address_lat'
=>
$address
L
at
,
'address'
=>
$address
,
'phone'
=>
$phone
,
'create_time'
=>
date
(
"Y-m-d H:i:s"
),
...
...
@@ -129,8 +129,8 @@ class ShopService
public
static
function
updateShop
(
$params
,
$where
)
{
$name
=
!
empty
(
$params
[
'name'
])
?
$params
[
'name'
]
:
''
;
$address
_l
ng
=
!
empty
(
$params
[
'address_lng'
])
?
$params
[
'address_lng'
]
:
''
;
$address
_l
at
=
!
empty
(
$params
[
'address_lat'
])
?
$params
[
'address_lat'
]
:
''
;
$address
L
ng
=
!
empty
(
$params
[
'address_lng'
])
?
$params
[
'address_lng'
]
:
''
;
$address
L
at
=
!
empty
(
$params
[
'address_lat'
])
?
$params
[
'address_lat'
]
:
''
;
$address
=
!
empty
(
$params
[
'address'
])
?
$params
[
'address'
]
:
''
;
$phone
=
!
empty
(
$params
[
'phone'
])
?
$params
[
'phone'
]
:
''
;
...
...
@@ -147,12 +147,12 @@ class ShopService
$colums
[
'name'
]
=
$name
;
}
if
(
!
empty
(
$address
_l
ng
))
{
$colums
[
'address_lng'
]
=
$address
_l
ng
;
if
(
!
empty
(
$address
L
ng
))
{
$colums
[
'address_lng'
]
=
$address
L
ng
;
}
if
(
!
empty
(
$address
_l
at
))
{
$colums
[
'address_lat'
]
=
$address
_l
at
;
if
(
!
empty
(
$address
L
at
))
{
$colums
[
'address_lat'
]
=
$address
L
at
;
}
if
(
!
empty
(
$address
))
{
...
...
application/services/shop/SubShopService.php
deleted
100644 → 0
View file @
e2dcf593
<?php
namespace
App\Services\goods
;
use
App\Models\goods\mysql\Category
;
class
CategoryService
{
public
static
function
getCategoryList
()
{
//todo::加上redis
$allCaregoryList
=
Category
::
getRecordList
([],
[
'category_id'
,
'parent_category_id'
,
'name'
,
'level'
]);
$data
=
[];
if
(
!
empty
(
$allCaregoryList
))
{
foreach
(
$allCaregoryList
as
$caregory
)
{
if
(
$caregory
[
"level"
]
==
Category
::
LEVEL_1
)
{
$data
[
"level_1"
][]
=
[
"category_id"
=>
$caregory
[
"category_id"
],
"name"
=>
$caregory
[
"name"
]
];
}
if
(
$caregory
[
"level"
]
==
Category
::
LEVEL_2
)
{
$data
[
"level_2"
][
$caregory
[
"parent_category_id"
]][]
=
[
"category_id"
=>
$caregory
[
"category_id"
],
"name"
=>
$caregory
[
"name"
]
];
}
}
}
return
$data
;
}
}
\ 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