Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
stock_new
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
stock_new
Commits
d6760c79
Commit
d6760c79
authored
Jun 25, 2024
by
twj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加股权隐藏功能
parent
adff3f4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
application/apicom/home/Esop.php
application/apicom/home/Esop.php
+20
-15
application/money/model/EsopPlan.php
application/money/model/EsopPlan.php
+1
-1
No files found.
application/apicom/home/Esop.php
View file @
d6760c79
...
@@ -20,6 +20,8 @@ class Esop extends Common
...
@@ -20,6 +20,8 @@ class Esop extends Common
// 获取查询条件
// 获取查询条件
$map
=
$this
->
getMap
();
$map
=
$this
->
getMap
();
$map
[
'mid'
]
=
MID
;
$map
[
'mid'
]
=
MID
;
//除去冻结期权
$map
[
'status'
]
=
1
;
$order
=
'id desc'
;
$order
=
'id desc'
;
$page
=
intval
(
$this
->
request
->
param
(
"page"
));
$page
=
intval
(
$this
->
request
->
param
(
"page"
));
$page
=
$page
?
$page
:
1
;
$page
=
$page
?
$page
:
1
;
...
@@ -37,7 +39,7 @@ class Esop extends Common
...
@@ -37,7 +39,7 @@ class Esop extends Common
}
}
/**
/**
* 期权
计划
* 期权
变化明细
* @return [type] [description]
* @return [type] [description]
*/
*/
public
function
getEsopPlanRecordList
()
public
function
getEsopPlanRecordList
()
...
@@ -57,15 +59,16 @@ class Esop extends Common
...
@@ -57,15 +59,16 @@ class Esop extends Common
$offset
=
$page
;
$offset
=
$page
;
// 数据列表
// 数据列表
$data_list
=
EsopPlanRecordModel
::
getEsopPlanRecordList
(
$map
,
$order
,
$offset
,
15
);
$data_list
=
EsopPlanRecordModel
::
getEsopPlanRecordList
(
$map
,
$order
,
$offset
,
15
);
foreach
(
$data_list
as
$k
=>
$v
)
{
if
(
$data_list
)
{
$data_list
[
$k
][
'affect'
]
=
bcdiv
(
$v
[
'affect'
],
100
,
2
);
foreach
(
$data_list
as
$k
=>
$v
)
{
$data_list
[
$k
][
'surplus'
]
=
bcdiv
(
$v
[
'surplus'
],
100
,
2
);
$data_list
[
$k
][
'affect'
]
=
bcdiv
(
$v
[
'affect'
],
100
,
2
);
$data_list
[
$k
][
'type'
]
=
getTypeNameForEsop
(
$v
[
'type'
]);
$data_list
[
$k
][
'surplus'
]
=
bcdiv
(
$v
[
'surplus'
],
100
,
2
);
$data_list
[
$k
][
'stock'
]
=
[];
$data_list
[
$k
][
'type'
]
=
getTypeNameForEsop
(
$v
[
'type'
]);
if
(
$v
[
'stock_trust_id'
])
{
$data_list
[
$k
][
'stock'
]
=
[];
if
(
$v
[
'stock_trust_id'
])
{
}
}
}
}
}
ajaxmsg
(
'数据列表'
,
1
,
$data_list
);
ajaxmsg
(
'数据列表'
,
1
,
$data_list
);
}
}
/**
/**
...
@@ -104,7 +107,7 @@ class Esop extends Common
...
@@ -104,7 +107,7 @@ class Esop extends Common
//期权计划id
//期权计划id
$data
[
'esop_plan_id'
]
=
$this
->
request
->
param
(
"esop_plan_id"
);
$data
[
'esop_plan_id'
]
=
$this
->
request
->
param
(
"esop_plan_id"
);
//密码
//密码
$data
[
'paywd'
]
=
$this
->
request
->
param
(
'paywd'
);
$data
[
'paywd'
]
=
$this
->
request
->
param
(
'paywd'
);
if
(
!
$data
[
'esop_plan_id'
])
{
if
(
!
$data
[
'esop_plan_id'
])
{
ajaxmsg
(
'请选择要提现的期权!'
,
0
);
ajaxmsg
(
'请选择要提现的期权!'
,
0
);
}
}
...
@@ -118,18 +121,20 @@ class Esop extends Common
...
@@ -118,18 +121,20 @@ class Esop extends Common
}
}
//判断是否是最低金额的整数倍
//判断是否是最低金额的整数倍
$minimum
=
config
(
'withdraw_minimum'
);
$minimum
=
config
(
'withdraw_minimum'
);
if
(
$data
[
'money'
]
%
$minimum
!=
0
)
{
if
(
$data
[
'money'
]
<
$minimum
)
{
ajaxmsg
(
'提现金额必须是最低金额的整数倍!'
,
0
);
ajaxmsg
(
'最低提现金额为'
.
$minimum
,
0
);
}
if
(
$data
[
'money'
]
%
500
!=
0
)
{
ajaxmsg
(
'提现金额必须是500的整数倍!'
,
0
);
}
}
//校验当前期权计划余额
//校验当前期权计划余额
$money_res
=
EsopPlanModel
::
where
([
'id'
=>
$data
[
'esop_plan_id'
]])
->
find
();
$money_res
=
EsopPlanModel
::
where
([
'id'
=>
$data
[
'esop_plan_id'
]])
->
find
();
if
(
empty
(
$money_res
[
'account'
])
||
(
$money_res
[
'account'
]
<=
0
))
{
if
(
empty
(
$money_res
[
'account'
])
||
(
$money_res
[
'account'
]
<=
0
))
{
ajaxmsg
(
'查询账户资金出错!'
.
$data
[
'esop_plan_id'
]
,
0
);
ajaxmsg
(
'查询账户资金出错!'
,
0
);
}
}
if
(
isset
(
$money_res
[
'account'
])
&&
$money_res
[
'account'
]
<
$data
[
'money'
])
{
if
(
isset
(
$money_res
[
'account'
])
&&
$money_res
[
'account'
]
<
$data
[
'money'
])
{
ajaxmsg
(
'提现金额已经大于可用余额!'
,
0
);
ajaxmsg
(
'提现金额已经大于可用余额!'
,
0
);
}
}
$data
[
'stock_id'
]
=
$money_res
[
'stock_id'
];
//查询是否已申请过提现,一次只能有一笔提现
//查询是否已申请过提现,一次只能有一笔提现
$withdraw_info
=
Db
::
name
(
'money_withdraw'
)
$withdraw_info
=
Db
::
name
(
'money_withdraw'
)
->
where
([
'mid'
=>
MID
])
->
where
([
'mid'
=>
MID
])
...
@@ -180,10 +185,10 @@ class Esop extends Common
...
@@ -180,10 +185,10 @@ class Esop extends Common
$updateData
=
[
$updateData
=
[
'account'
=>
$v
[
'account'
]
+
$affect
,
'account'
=>
$v
[
'account'
]
+
$affect
,
'days'
=>
$v
[
'days'
]
+
1
,
'days'
=>
$v
[
'days'
]
+
1
,
'remain_account'
=>
$v
[
'
pla
n_account'
]
-
$affect
,
'remain_account'
=>
$v
[
'
remai
n_account'
]
-
$affect
,
'release_account'
=>
$v
[
'release_account'
]
+
$affect
'release_account'
=>
$v
[
'release_account'
]
+
$affect
];
];
EsopPlanModel
::
where
([
'id'
=>
$v
[
'id'
]])
->
update
(
$updateData
);
EsopPlanModel
::
where
([
'id'
=>
$v
[
'id'
]])
->
update
(
$updateData
);
//写入明细表
//写入明细表
$arr
=
[
$arr
=
[
'mid'
=>
$v
[
'mid'
],
'mid'
=>
$v
[
'mid'
],
...
...
application/money/model/EsopPlan.php
View file @
d6760c79
...
@@ -43,7 +43,7 @@ class EsopPlan extends Model
...
@@ -43,7 +43,7 @@ class EsopPlan extends Model
*/
*/
public
static
function
getEsopPlanList
(
$where
=
[],
$order
=
'id asc'
,
$offset
,
$pagesize
=
15
)
public
static
function
getEsopPlanList
(
$where
=
[],
$order
=
'id asc'
,
$offset
,
$pagesize
=
15
)
{
{
$esop_plan_list
=
self
::
view
(
'esop_plan ep'
,
'id,mid,account,plan_account,release_account,remain_account,release_time,duration,days'
)
$esop_plan_list
=
self
::
view
(
'esop_plan ep'
,
'id,mid,account,plan_account,release_account,remain_account,release_time,duration,days
,status
'
)
->
view
(
"stock_list sl"
,
'title,code'
,
'sl.id=ep.stock_id'
,
'left'
)
->
view
(
"stock_list sl"
,
'title,code'
,
'sl.id=ep.stock_id'
,
'left'
)
->
field
([
"CONCAT(ROUND(release_account / plan_account * 100, 2), ' % ')"
=>
'accuracy'
])
->
field
([
"CONCAT(ROUND(release_account / plan_account * 100, 2), ' % ')"
=>
'accuracy'
])
->
field
([
"FROM_UNIXTIME(ep.create_time,'%Y-%m-%d %T')"
=>
'create_time'
])
->
field
([
"FROM_UNIXTIME(ep.create_time,'%Y-%m-%d %T')"
=>
'create_time'
])
...
...
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