Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
91c1dda2
Commit
91c1dda2
authored
Oct 17, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
锁仓规则添加所属公司名称字段
parent
52b4ccbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
CoinPublishRuleController.php
backend/controllers/CoinPublishRuleController.php
+9
-8
CoinPublishRule.php
common/models/psources/CoinPublishRule.php
+3
-1
No files found.
backend/controllers/CoinPublishRuleController.php
View file @
91c1dda2
...
@@ -119,26 +119,27 @@ class CoinPublishRuleController extends BaseController
...
@@ -119,26 +119,27 @@ class CoinPublishRuleController extends BaseController
$model
->
scenario
=
CoinPublishRule
::
SCENARIOS_ADD
;
$model
->
scenario
=
CoinPublishRule
::
SCENARIOS_ADD
;
// 编号
// 编号
$prefix
=
date
(
'Ymd'
,
time
());
$prefix
=
date
(
'Ymd'
,
time
());
$form_database
=
CoinPublishRule
::
find
()
$form_database
=
CoinPublishRule
::
find
()
->
where
([
'like'
,
'sid'
,
$prefix
])
->
orderBy
([
'sid'
=>
SORT_DESC
])
->
asArray
()
->
One
();
->
where
([
'like'
,
'sid'
,
$prefix
])
->
orderBy
([
'sid'
=>
SORT_DESC
])
->
asArray
()
->
One
();
if
(
$form_database
)
{
if
(
$form_database
)
{
$sid
=
(
int
)
$form_database
[
'sid'
]
+
1
;
$sid
=
(
int
)
$form_database
[
'sid'
]
+
1
;
}
else
{
}
else
{
$sid
=
$prefix
.
'001'
;
$sid
=
$prefix
.
'001'
;
}
}
$model
->
platform_id
=
3
;
$model
->
platform_id
=
2
;
}
}
if
(
$model
->
load
(
$post
)
&&
$model
->
validate
())
{
if
(
$model
->
load
(
$post
)
&&
$model
->
validate
())
{
if
(
CoinPublishRule
::
SCENARIOS_ADD
==
$model
->
scenario
)
{
if
(
CoinPublishRule
::
SCENARIOS_ADD
==
$model
->
scenario
)
{
$model
->
sid
=
(
string
)
$sid
;
$model
->
sid
=
(
string
)
$sid
;
}
}
$model
->
release_time
=
date_create_from_format
(
self
::
DATE_FORMAT
[
$model
->
repeat
],
$model
->
release_time
=
date_create_from_format
(
self
::
DATE_FORMAT
[
$model
->
repeat
],
$model
->
release_time
)
->
format
(
'Y-m-d H:i:s'
);
$model
->
release_time
)
->
format
(
'Y-m-d H:i:s'
);
empty
(
$model
->
pid
)
&&
$model
->
pid
=
$this
->
getPid
();
empty
(
$model
->
pid
)
&&
$model
->
pid
=
$this
->
getPid
();
$rule
=
CoinPublish
::
findOne
(
$model
->
pid
);
if
(
empty
(
$rule
))
{
return
[
'code'
=>
-
1
,
'msg'
=>
'锁仓规则不存在'
];
}
else
{
$model
->
company_name
=
$rule
->
owner
;
}
if
(
$model
->
save
())
{
if
(
$model
->
save
())
{
if
(
$model
->
qid
)
{
if
(
$model
->
qid
)
{
//删除原有的任务
//删除原有的任务
...
...
common/models/psources/CoinPublishRule.php
View file @
91c1dda2
...
@@ -15,6 +15,7 @@ use Yii;
...
@@ -15,6 +15,7 @@ use Yii;
* 锁仓规则表
* 锁仓规则表
*
*
* @param integer $qid 任务id
* @param integer $qid 任务id
* @param integer $pid 监控币种id
*/
*/
class
CoinPublishRule
extends
BaseActiveRecord
class
CoinPublishRule
extends
BaseActiveRecord
{
{
...
@@ -69,6 +70,7 @@ class CoinPublishRule extends BaseActiveRecord
...
@@ -69,6 +70,7 @@ class CoinPublishRule extends BaseActiveRecord
'release_time'
=>
'释放时间'
,
'release_time'
=>
'释放时间'
,
'notice'
=>
'备注'
,
'notice'
=>
'备注'
,
'pid'
=>
'规则id'
,
'pid'
=>
'规则id'
,
'company_name'
=>
'所属公司名称'
,
];
];
}
}
...
@@ -83,7 +85,7 @@ class CoinPublishRule extends BaseActiveRecord
...
@@ -83,7 +85,7 @@ class CoinPublishRule extends BaseActiveRecord
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'sid'
,
'release_time'
,
'notice'
],
'string'
],
[[
'sid'
,
'release_time'
,
'notice'
,
'company_name'
],
'string'
],
[[
'sid'
,
'release_time'
],
'string'
,
'max'
=>
255
],
[[
'sid'
,
'release_time'
],
'string'
,
'max'
=>
255
],
[[
'release_time'
],
'validateTime'
],
[[
'release_time'
],
'validateTime'
],
[[
'id'
,
'lock'
,
'release'
,
'type'
,
'repeat'
,
'pid'
],
'integer'
],
[[
'id'
,
'lock'
,
'release'
,
'type'
,
'repeat'
,
'pid'
],
'integer'
],
...
...
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