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
1e7c0800
Commit
1e7c0800
authored
Mar 11, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增活动
parent
0f0eff3e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
44 deletions
+69
-44
Activity.php
application/api/controller/Activity.php
+0
-42
Activity.php
application/index/controller/Activity.php
+67
-0
route.php
application/route.php
+2
-2
No files found.
application/api/controller/Activity.php
View file @
1e7c0800
...
...
@@ -22,45 +22,4 @@ class Activity extends Basic
$this
->
activityService
=
new
ActivityService
();
}
public
function
createActivity
()
{
$params
=
$this
->
params
;
/* $params = array(
'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
);
}
$title
=
$params
[
"title"
];
$return_type
=
$params
[
"return_type"
];
$money
=
$params
[
"money"
];
$return_action
=
$params
[
"return_action"
];
$activity_start_time
=
$params
[
"activity_start_time"
];
$activity_end_time
=
$params
[
"activity_end_time"
];
$use_period
=
$params
[
"use_period"
];
$total
=
$params
[
"total"
];
$available
=
$params
[
"available"
];
$activity_rule
=
$params
[
"activity_rule"
];
if
(
$activity_start_time
<=
time
()
||
$activity_end_time
<
time
()){
return
$this
->
response
(
"101"
,
"活动开始时间和结束时间不能小于当前时间"
);
}
$is_ok
=
$this
->
activityService
->
createActivity
(
$title
,
$return_type
,
$money
,
$return_action
,
$activity_start_time
,
$activity_end_time
,
$use_period
,
$total
,
$available
,
$activity_rule
);
if
(
$is_ok
>
0
){
return
$this
->
response
(
"200"
,
"add success"
);
}
else
{
return
$this
->
response
(
"101"
,
"faild"
);
}
}
}
\ No newline at end of file
application/index/controller/Activity.php
0 → 100644
View file @
1e7c0800
<?php
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\api\service\ActivityService
;
use
think\Request
;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/3/11
* Time: 9:46
*/
class
Activity
extends
Basic
{
private
$activityService
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
activityService
=
new
ActivityService
();
}
public
function
createActivity
()
{
$params
=
$this
->
params
;
/* $params = array(
'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
);
}
$title
=
$params
[
"title"
];
$return_type
=
$params
[
"return_type"
];
$money
=
$params
[
"money"
];
$return_action
=
$params
[
"return_action"
];
$activity_start_time
=
$params
[
"activity_start_time"
];
$activity_end_time
=
$params
[
"activity_end_time"
];
$use_period
=
$params
[
"use_period"
];
$total
=
$params
[
"total"
];
$available
=
$params
[
"available"
];
$activity_rule
=
$params
[
"activity_rule"
];
if
(
$activity_start_time
<=
time
()
||
$activity_end_time
<
time
()){
return
$this
->
response
(
"101"
,
"活动开始时间和结束时间不能小于当前时间"
);
}
$is_ok
=
$this
->
activityService
->
createActivity
(
$title
,
$return_type
,
$money
,
$return_action
,
$activity_start_time
,
$activity_end_time
,
$use_period
,
$total
,
$available
,
$activity_rule
);
if
(
$is_ok
>
0
){
return
$this
->
response
(
"200"
,
"add success"
);
}
else
{
return
$this
->
response
(
"101"
,
"faild"
);
}
}
}
\ No newline at end of file
application/route.php
View file @
1e7c0800
...
...
@@ -421,6 +421,8 @@ Route::group('index', [
'addUserBind'
=>
[
'index/member/addUserBind'
,
[
'method'
=>
'get|post'
]
],
'removeUserBind'
=>
[
'index/member/removeUserBind'
,
[
'method'
=>
'get|post'
]
],
'getUserBindHistory'
=>
[
'index/member/getUserBindHistory'
,
[
'method'
=>
'get|post'
]
],
'createActivity'
=>
[
'index/Activity/createActivity'
,
[
'method'
=>
'POST|GET'
]],
//新增活动
]);
...
...
@@ -512,8 +514,6 @@ Route::group('api', [
'addUserCallAgent'
=>
[
'api/CallAgent/addUserCallAgent'
,
[
'method'
=>
'POST|GET'
]],
//客户来电记录
'addUserCallAgentV2'
=>
[
'api/CallAgent/addUserCallAgentV2'
,
[
'method'
=>
'POST|GET'
]],
//客户来电记录h5
'createActivity'
=>
[
'api/Activity/createActivity'
,
[
'method'
=>
'POST|GET'
]],
//新增活动
]);
...
...
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