Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
2662808c
Commit
2662808c
authored
Mar 11, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
fdc1ba60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
16 deletions
+33
-16
Activity.php
application/index/controller/Activity.php
+19
-16
CActivity.php
application/model/CActivity.php
+14
-0
No files found.
application/index/controller/Activity.php
View file @
2662808c
...
...
@@ -31,19 +31,19 @@ class Activity extends Basic
public
function
saveActivity
()
{
$params
=
$this
->
params
;
/*$params = array(
//'id' => 1,
'title' => '活动1',
'return_type' => '1',
'money' => '1121',
'return_action' => '0',
'activity_start_time' => time(),
'activity_end_time' => time(),
'use_period' => 30,
'total' => 100,
'available' => 1,
'activity_rule' => '加拉时间的发送去问问人情味',
);*/
/*$params = array(
//'id' => 1,
'title' => '活动1',
'return_type' => '1',
'money' => '1121',
'return_action' => '0',
'activity_start_time' => time(),
'activity_end_time' => time(),
'use_period' => 30,
'total' => 100,
'available' => 1,
'activity_rule' => '加拉时间的发送去问问人情味',
);*/
$checkResult
=
$this
->
validate
(
$params
,
"ActivityValidate.create"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
...
...
@@ -58,10 +58,10 @@ class Activity extends Basic
$total
=
$params
[
"total"
];
$available
=
$params
[
"available"
];
$activity_rule
=
$params
[
"activity_rule"
];
if
((
$return_action
==
0
||
$return_action
==
1
)
&&
$return_type
!=
0
)
{
if
((
$return_action
==
0
||
$return_action
==
1
)
&&
$return_type
!=
0
)
{
return
$this
->
response
(
"101"
,
"奖励动作为首次或邀请登陆,奖励类型必须为返现红包"
);
}
if
(
$return_type
==
1
&&
$use_period
>
0
)
{
if
(
$return_type
==
1
&&
$use_period
>
0
)
{
return
$this
->
response
(
"101"
,
"奖励类型为现金的奖励有效期必须为永久"
);
}
...
...
@@ -116,7 +116,10 @@ class Activity extends Basic
}
$where_
[
"status"
]
=
array
(
"neq"
,
4
);
$list
=
$activityModel
->
getActivityList
(
$field
,
$where_
,
$pageNo
,
$pageSize
);
return
$this
->
response
(
"200"
,
"success"
,
$list
);
$count
=
$activityModel
->
getActivityCount
(
$field
,
$where_
);
$result
[
"list"
]
=
$list
;
$result
[
"total"
]
=
$count
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
...
...
application/model/CActivity.php
View file @
2662808c
...
...
@@ -89,6 +89,20 @@ class CActivity extends Model
return
$result
;
}
/**
* @param $field
* @param $params
* @return int|string
*/
public
function
getActivityCount
(
$field
,
$params
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
count
();
return
$result
;
}
/**
* 更新
* @param $activity_id
...
...
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