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
1c32d4e8
Commit
1c32d4e8
authored
Aug 06, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 活动绑定自提点接口 参数修改 offset改成page
parent
43576008
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
TakePlaceValidate.php
application/library/Validate/TakePlaceValidate.php
+3
-1
Takeplace.php
application/modules/Marketing/controllers/Takeplace.php
+2
-2
TakePlaceService.php
application/services/marketing/TakePlaceService.php
+6
-3
No files found.
application/library/Validate/TakePlaceValidate.php
View file @
1c32d4e8
...
@@ -20,6 +20,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
...
@@ -20,6 +20,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
'province'
=>
'require'
,
'province'
=>
'require'
,
'city'
=>
'require'
,
'city'
=>
'require'
,
'area'
=>
'require'
,
'area'
=>
'require'
,
'page'
=>
'egt:1'
,
'offset'
=>
'egt:0'
,
'offset'
=>
'egt:0'
,
'limit'
=>
'elt:500'
,
'limit'
=>
'elt:500'
,
];
];
...
@@ -34,6 +35,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
...
@@ -34,6 +35,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
"province"
=>
"省不能为空"
,
"province"
=>
"省不能为空"
,
"city"
=>
"市不能为空"
,
"city"
=>
"市不能为空"
,
"area"
=>
"区不能为空"
,
"area"
=>
"区不能为空"
,
'page'
=>
'偏移量不能小于1'
,
"offset"
=>
"偏移量不能小于0"
,
"offset"
=>
"偏移量不能小于0"
,
"limit"
=>
"单次不能大于500条"
,
"limit"
=>
"单次不能大于500条"
,
];
];
...
@@ -55,6 +57,6 @@ class TakePlaceValidate extends \Validate\BaseValidate
...
@@ -55,6 +57,6 @@ class TakePlaceValidate extends \Validate\BaseValidate
public
function
sceneBindList
()
public
function
sceneBindList
()
{
{
return
$this
->
append
([
'marketing_id'
=>
'require'
])
->
only
([
'marketing_id'
,
'
offset
'
,
'limit'
]);
return
$this
->
append
([
'marketing_id'
=>
'require'
])
->
only
([
'marketing_id'
,
'
page
'
,
'limit'
]);
}
}
}
}
\ No newline at end of file
application/modules/Marketing/controllers/Takeplace.php
View file @
1c32d4e8
...
@@ -64,10 +64,10 @@ class TakeplaceController extends Base
...
@@ -64,10 +64,10 @@ class TakeplaceController extends Base
$marketingId
=
$this
->
params
[
'marketing_id'
];
$marketingId
=
$this
->
params
[
'marketing_id'
];
$takePlaceName
=
$this
->
params
[
'take_place_name'
]
??
''
;
$takePlaceName
=
$this
->
params
[
'take_place_name'
]
??
''
;
$
offset
=
$this
->
params
[
'offset'
]
??
0
;
$
page
=
$this
->
params
[
'page'
]
??
1
;
$limit
=
$this
->
params
[
'limit'
]
??
20
;
$limit
=
$this
->
params
[
'limit'
]
??
20
;
$data
=
TakePlaceService
::
getPindanTakePlaceList
(
$marketingId
,
$takePlaceName
,
$
offset
,
$limit
);
$data
=
TakePlaceService
::
getPindanTakePlaceList
(
$marketingId
,
$takePlaceName
,
$
page
,
$limit
);
$this
->
success
([
'result'
=>
$data
]);
$this
->
success
([
'result'
=>
$data
]);
}
}
...
...
application/services/marketing/TakePlaceService.php
View file @
1c32d4e8
...
@@ -109,12 +109,13 @@ class TakePlaceService
...
@@ -109,12 +109,13 @@ class TakePlaceService
* 获取拼单活动绑定的自提点列表
* 获取拼单活动绑定的自提点列表
* @param $marketingPindanId
* @param $marketingPindanId
* @param string $takePlaceName
* @param string $takePlaceName
* @param int $
offset
* @param int $
page
* @param int $limit
* @param int $limit
* @return array
* @return array
*/
*/
public
static
function
getPindanTakePlaceList
(
$marketingPindanId
,
$takePlaceName
=
''
,
$
offset
=
0
,
$limit
=
20
)
public
static
function
getPindanTakePlaceList
(
$marketingPindanId
,
$takePlaceName
=
''
,
$
page
=
1
,
$limit
=
20
)
{
{
$offset
=
(
$page
-
1
)
*
$limit
;
$res
=
[
'list'
=>
[],
'total'
=>
0
];
$res
=
[
'list'
=>
[],
'total'
=>
0
];
$where
=
[
'marketing_id'
=>
$marketingPindanId
];
$where
=
[
'marketing_id'
=>
$marketingPindanId
];
$takePlaceName
&&
$where
[
'take_place_name[~]'
]
=
$takePlaceName
;
$takePlaceName
&&
$where
[
'take_place_name[~]'
]
=
$takePlaceName
;
...
@@ -129,7 +130,9 @@ class TakePlaceService
...
@@ -129,7 +130,9 @@ class TakePlaceService
$makePlaceIds
=
array_column
(
$relations
,
'take_place_id'
);
$makePlaceIds
=
array_column
(
$relations
,
'take_place_id'
);
$takePlaceWhere
=
[
'take_place_id'
=>
$makePlaceIds
];
$takePlaceWhere
=
[
'take_place_id'
=>
$makePlaceIds
];
$res
[
'list'
]
=
TakePlace
::
select
(
'*'
,
$takePlaceWhere
);
$res
[
'list'
]
=
TakePlace
::
select
(
'*'
,
$takePlaceWhere
);
$res
[
'total'
]
=
TakePlace
::
count
(
'*'
,
$takePlaceWhere
);
unset
(
$where
[
'ORDER'
],
$where
[
'LIMIT'
]);
$res
[
'total'
]
=
MarketingTakePlace
::
count
(
'*'
,
$where
);
$res
[
'total_page'
]
=
ceil
(
$res
[
'total'
]
/
$limit
);
return
$res
;
return
$res
;
}
}
...
...
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