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
0f75dda7
Commit
0f75dda7
authored
Mar 14, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
8d50020e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
14 deletions
+12
-14
ActivityService.php
application/api/service/ActivityService.php
+3
-6
Activity.php
application/index/controller/Activity.php
+4
-4
ActivityValidate.php
application/index/validate/ActivityValidate.php
+5
-4
No files found.
application/api/service/ActivityService.php
View file @
0f75dda7
...
...
@@ -19,10 +19,10 @@ class ActivityService
$this
->
activityModel
=
new
CActivity
();
}
public
function
createActivity
(
$id
,
$title
,
$
return_type
,
$
money
,
$return_action
,
$activity_start_time
,
public
function
createActivity
(
$id
,
$title
,
$money
,
$return_action
,
$activity_start_time
,
$activity_end_time
,
$use_period
,
$total
,
$available
,
$activity_rule
)
{
$arr
=
$this
->
activityBin
(
$id
,
$title
,
$
return_type
,
$
money
,
$return_action
,
$activity_start_time
,
$arr
=
$this
->
activityBin
(
$id
,
$title
,
$money
,
$return_action
,
$activity_start_time
,
$activity_end_time
,
$use_period
,
$total
,
$available
,
$activity_rule
);
$id
=
0
;
if
(
$id
>
0
){
...
...
@@ -35,7 +35,7 @@ class ActivityService
}
private
function
activityBin
(
$id
,
$title
,
$
return_type
,
$
money
,
$return_action
,
$activity_start_time
,
private
function
activityBin
(
$id
,
$title
,
$money
,
$return_action
,
$activity_start_time
,
$activity_end_time
,
$use_period
,
$total
,
$available
,
$activity_rule
)
{
if
(
$id
==
0
)
{
...
...
@@ -44,9 +44,6 @@ class ActivityService
if
(
!
empty
(
$title
))
{
$arr
[
"title"
]
=
$title
;
}
if
(
isset
(
$return_type
))
{
$arr
[
"return_type"
]
=
$return_type
;
}
if
(
!
empty
(
$money
))
{
$arr
[
"money"
]
=
$money
;
}
...
...
application/index/controller/Activity.php
View file @
0f75dda7
...
...
@@ -49,7 +49,7 @@ class Activity extends Basic
return
$this
->
response
(
"101"
,
$checkResult
);
}
$title
=
$params
[
"title"
];
$return_type
=
$params
[
"return_type"
];
//
$return_type = $params["return_type"];
$money
=
$params
[
"money"
];
$return_action
=
$params
[
"return_action"
];
$activity_start_time
=
$params
[
"activity_start_time"
];
...
...
@@ -58,12 +58,12 @@ 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) {
return $this->response("101", "奖励类型为现金的奖励有效期必须为永久");
}
}
*/
//编辑
$id
=
0
;
...
...
@@ -75,7 +75,7 @@ class Activity extends Basic
}
}
$is_ok
=
$this
->
activityService
->
createActivity
(
$id
,
$title
,
$
return_type
,
$
money
,
$return_action
,
$activity_start_time
,
$is_ok
=
$this
->
activityService
->
createActivity
(
$id
,
$title
,
$money
,
$return_action
,
$activity_start_time
,
$activity_end_time
,
$use_period
,
$total
,
$available
,
$activity_rule
);
if
(
$is_ok
>
0
)
{
return
$this
->
response
(
"200"
,
"success"
);
...
...
application/index/validate/ActivityValidate.php
View file @
0f75dda7
...
...
@@ -15,7 +15,7 @@ class ActivityValidate extends Validate
protected
$rule
=
[
'id'
=>
'require'
,
'title'
=>
'require|length:1,80'
,
'return_type'
=>
'require|in:0,1'
,
//
'return_type' => 'require|in:0,1',
'money'
=>
'require|number|gt:0|lt:5000'
,
'return_action'
=>
'require|in:0,1,2'
,
'activity_start_time'
=>
'require'
,
...
...
@@ -31,8 +31,8 @@ class ActivityValidate extends Validate
protected
$message
=
[
'id.require'
=>
'活动id不能为空'
,
'title.length:1,80'
=>
'活动标题字数必须1-80'
,
'return_type.require'
=>
'奖励类型为必须字段'
,
'return_type.in'
=>
'奖励类型错误'
,
/*
'return_type.require' => '奖励类型为必须字段',
'return_type.in' => '奖励类型错误',
*/
'money.require'
=>
'奖励金额为必填'
,
'money.number'
=>
'奖励金额必须是数字'
,
'money.gt'
=>
'奖励金额必须大于0'
,
...
...
@@ -57,7 +57,7 @@ class ActivityValidate extends Validate
];
protected
$scene
=
[
'create'
=>
[
'title'
,
'return_type'
,
'money'
,
'return_action'
,
'activity_start_time'
,
'activity_end_time'
,
'use_period'
,
'create'
=>
[
'title'
,
'money'
,
'return_action'
,
'activity_start_time'
,
'activity_end_time'
,
'use_period'
,
'total'
,
'available'
,
'activity_rule'
],
];
}
\ 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