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
7bd96762
Commit
7bd96762
authored
Jun 19, 2024
by
董先生
Browse files
Options
Browse Files
Download
Plain Diff
持仓列表
parents
d0e30254
f063e4f4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
10 deletions
+32
-10
application/common.php
application/common.php
+1
-1
application/market/home/Trade.php
application/market/home/Trade.php
+1
-1
application/market/model/Position.php
application/market/model/Position.php
+22
-0
application/money/admin/Esopplan.php
application/money/admin/Esopplan.php
+6
-6
application/money/model/EsopPlan.php
application/money/model/EsopPlan.php
+2
-2
No files found.
application/common.php
View file @
7bd96762
...
...
@@ -2209,4 +2209,4 @@ if(!function_exists('get_between')) {
}
}
}
\ No newline at end of file
}
application/market/home/Trade.php
View file @
7bd96762
This diff is collapsed.
Click to expand it.
application/market/model/Position.php
View file @
7bd96762
...
...
@@ -391,5 +391,27 @@ class Position extends Model{
return
$result
;
}
public
static
function
calculate
(
$sub_id
,
$code
,
$variable
)
{
if
(
!
$sub_id
||
!
$code
||
!
$variable
)
return
0
;
switch
(
$variable
)
{
case
'price'
:
$order
=
Db
::
name
(
'stock_delivery_order'
)
->
where
([
'sub_id'
=>
$sub_id
,
'gupiao_code'
=>
$code
,
'status'
=>
1
,
'business_name'
=>
'证券买入'
]);
$amount
=
$order
->
sum
(
'liquidation_amount'
);
$volume
=
$order
->
sum
(
'volume'
);
$result
=
bcdiv
(
strval
(
$amount
),
strval
(
$volume
),
3
);
break
;
case
'average'
:
$order
=
Db
::
name
(
'stock_delivery_order'
)
->
where
([
'sub_id'
=>
$sub_id
,
'gupiao_code'
=>
$code
,
'status'
=>
1
,
'business_name'
=>
'证券买入'
]);
$amount
=
$order
->
sum
(
'residual_quantity'
);
$volume
=
$order
->
sum
(
'volume'
);
$result
=
bcdiv
(
strval
(
$amount
),
strval
(
$volume
),
3
);
break
;
default
:
$result
=
0
;
break
;
}
return
$result
;
}
}
\ No newline at end of file
application/
esop/admin/Index
.php
→
application/
money/admin/Esopplan
.php
View file @
7bd96762
...
...
@@ -4,7 +4,7 @@ namespace app\money\admin;
use
app\admin\controller\Admin
;
use
app\common\builder\ZBuilder
;
use
app\
esop\model\Plan
as
PlanModel
;
use
app\
money\model\EsopPlan
as
Esop
PlanModel
;
use
think\Db
;
use
think\Hook
;
use
think\Cache
;
...
...
@@ -13,7 +13,7 @@ use think\Cache;
* 期权计划管理控制器
* @package app\money\admin
*/
class
Index
extends
Admin
class
Esopplan
extends
Admin
{
/**
* 首页
...
...
@@ -27,7 +27,7 @@ class Index extends Admin
$order
=
$this
->
getOrder
();
empty
(
$order
)
&&
$order
=
'id desc'
;
// 数据列表
$data_list
=
PlanModel
::
getAll
(
$map
,
$order
);
$data_list
=
Esop
PlanModel
::
getAll
(
$map
,
$order
);
// 分页数据
$page
=
$data_list
->
render
();
...
...
@@ -76,7 +76,7 @@ class Index extends Admin
$order
=
$this
->
getOrder
();
empty
(
$order
)
&&
$order
=
'id desc'
;
// 数据列表
$xlsData
=
PlanModel
::
getAll
(
$map
,
$order
);
$xlsData
=
Esop
PlanModel
::
getAll
(
$map
,
$order
);
$title
=
"期权计划列表"
;
$arrHeader
=
array
(
'ID'
,
'手机号'
,
'姓名'
,
'股票'
,
'可用期权'
,
'期权总值'
,
'待释放'
,
'已释放'
,
'总释放天数'
,
'已释放天数'
,
'开始释放时间'
,
'创建时间'
,
'状态'
);
...
...
@@ -95,8 +95,8 @@ class Index extends Admin
$value
*=
100
;
}
$mid
=
PlanModel
::
where
(
'id'
,
$id
)
->
value
(
'mid'
);
$old_value
=
PlanModel
::
where
(
'id'
,
$id
)
->
value
(
$field
);
$mid
=
Esop
PlanModel
::
where
(
'id'
,
$id
)
->
value
(
'mid'
);
$old_value
=
Esop
PlanModel
::
where
(
'id'
,
$id
)
->
value
(
$field
);
$mobile
=
Db
(
'member'
)
->
where
(
'id'
,
$mid
)
->
value
(
'mobile'
);
$details
=
$mobile
.
' 字段('
.
$field
.
'),原值:('
.
$old_value
.
')新值:('
.
$value
.
')'
;
...
...
application/
esop/model/
Plan.php
→
application/
money/model/Esop
Plan.php
View file @
7bd96762
<?php
namespace
app\
esop
\model
;
namespace
app\
money
\model
;
use
think\helper\Hash
;
use
app\money\model\Role
as
RoleModel
;
use
think\model
;
use
think\Db
;
class
Plan
extends
Model
class
Esop
Plan
extends
Model
{
// 设置当前模型对应的完整数据表名称
...
...
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