Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
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
刘小敏
loveisland
Commits
035f6571
Commit
035f6571
authored
Apr 25, 2026
by
龚双喜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'staff/gongshuangxi' into dev
parents
4207ff6d
0da9431f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
Index.php
addons/shopro/controller/Index.php
+25
-1
No files found.
addons/shopro/controller/Index.php
View file @
035f6571
...
@@ -10,13 +10,15 @@ use app\common\library\Sms as Smslib;
...
@@ -10,13 +10,15 @@ use app\common\library\Sms as Smslib;
use
app\admin\model\shopro\user\User
as
UserModel
;
use
app\admin\model\shopro\user\User
as
UserModel
;
use
addons\shopro\facade\Wechat
;
use
addons\shopro\facade\Wechat
;
use
app\common\model\shopro\Ad
;
use
app\common\model\shopro\Ad
;
use
think\Db
;
use
think\Hook
;
use
think\Hook
;
use
think\Log
;
class
Index
extends
Common
class
Index
extends
Common
{
{
use
Util
;
use
Util
;
protected
$noNeedLogin
=
[
'init'
,
'pageSync'
,
'page'
,
'feedback'
,
'send'
,
'test'
,
'ad'
];
protected
$noNeedLogin
=
[
'init'
,
'pageSync'
,
'page'
,
'feedback'
,
'send'
,
'test'
,
'ad'
,
'monthlyNewGoods'
];
protected
$noNeedRight
=
[
'*'
];
protected
$noNeedRight
=
[
'*'
];
public
function
init
()
public
function
init
()
...
@@ -200,6 +202,28 @@ class Index extends Common
...
@@ -200,6 +202,28 @@ class Index extends Common
/**
/**
* 获取每月最新商品
* 每月取最新上架的商品,没有返回空
*/
public
function
monthlyNewGoods
()
{
$limit
=
$this
->
request
->
param
(
'limit'
,
10
);
$month
=
$this
->
request
->
param
(
'month'
,
date
(
'Y-m'
));
$goods
=
\app\admin\model\shopro\goods\Goods
::
where
(
'status'
,
'up'
)
->
field
(
'id,title,image,original_price,price'
)
->
whereTime
(
'createtime'
,
'between'
,
[
"
{
$month
}
-01"
,
"
{
$month
}
-31"
])
->
order
(
'createtime'
,
'desc'
)
->
limit
(
$limit
)
->
select
();
if
(
!
$goods
)
{
$this
->
success
(
'获取成功'
,
[]);
}
$this
->
success
(
'获取成功'
,
$goods
);
}
/**
* 获取统一验证 token
* 获取统一验证 token
*
*
* @return void
* @return void
...
...
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