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
ce05fe6f
Commit
ce05fe6f
authored
Jun 22, 2024
by
twj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页隐藏部分信息,提现审核和接口调整
parent
45f25511
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
280 additions
and
132 deletions
+280
-132
application/apicom/home/Esop.php
application/apicom/home/Esop.php
+59
-2
application/apicom/home/Withdraw.php
application/apicom/home/Withdraw.php
+3
-2
application/money/admin/Esopplan.php
application/money/admin/Esopplan.php
+5
-2
application/money/admin/Esopplanrecord.php
application/money/admin/Esopplanrecord.php
+1
-50
application/money/admin/Withdraw.php
application/money/admin/Withdraw.php
+57
-53
application/money/model/EsopPlan.php
application/money/model/EsopPlan.php
+115
-7
application/money/model/Withdraw.php
application/money/model/Withdraw.php
+2
-1
application/stock/model/StockList.php
application/stock/model/StockList.php
+23
-0
plugins/SystemInfo/view/widget.html
plugins/SystemInfo/view/widget.html
+2
-2
plugins/waitingProcess/view/widget.html
plugins/waitingProcess/view/widget.html
+13
-13
No files found.
application/apicom/home/Esop.php
View file @
ce05fe6f
...
...
@@ -103,6 +103,8 @@ class Esop extends Common
$data
[
'money'
]
=
$this
->
request
->
param
(
"money"
);
//期权计划id
$data
[
'esop_plan_id'
]
=
$this
->
request
->
param
(
"esop_plan_id"
);
//密码
$data
[
'paywd'
]
=
$this
->
request
->
param
(
'paywd'
);
if
(
!
$data
[
'esop_plan_id'
])
{
ajaxmsg
(
'请选择要提现的期权!'
,
0
);
}
...
...
@@ -111,13 +113,18 @@ class Esop extends Common
if
(
true
!==
$result
)
{
ajaxmsg
(
$result
,
0
);
}
if
(
$data
[
'money'
]
<
0
)
{
if
(
$data
[
'money'
]
<
=
0
)
{
ajaxmsg
(
'提现金额错误!'
,
0
);
}
//判断是否是最低金额的整数倍
$minimum
=
config
(
'withdraw_minimum'
);
if
(
$data
[
'money'
]
%
$minimum
!=
0
)
{
ajaxmsg
(
'提现金额必须是最低金额的整数倍!'
,
0
);
}
//校验当前期权计划余额
$money_res
=
EsopPlanModel
::
where
([
'id'
=>
$data
[
'esop_plan_id'
]])
->
find
();
if
(
empty
(
$money_res
[
'account'
])
||
(
$money_res
[
'account'
]
<=
0
))
{
ajaxmsg
(
'查询账户资金出错!'
,
0
);
ajaxmsg
(
'查询账户资金出错!'
.
$data
[
'esop_plan_id'
]
,
0
);
}
if
(
isset
(
$money_res
[
'account'
])
&&
$money_res
[
'account'
]
<
$data
[
'money'
])
{
ajaxmsg
(
'提现金额已经大于可用余额!'
,
0
);
...
...
@@ -143,4 +150,54 @@ class Esop extends Common
ajaxmsg
(
'提现申请提交失败'
,
0
);
}
}
/**
* 自动任务,根据设定的期权计划执行释放期权
*/
public
function
releaseEsop
()
{
$where
=
[];
//正在执行的期权计划
$where
[
'status'
]
=
1
;
//开始释放期权日期不大于当前日期
$where
[
'release_time'
]
=
[
'<='
,
date
(
"Y-m-d"
)];
//待行权值大于0
$where
[
'remain_account'
]
=
[
'>'
,
0
];
//已释放天数小于总天数,已释放期权小于期权总值
$esop_plan_list
=
EsopPlanModel
::
where
(
$where
)
->
where
(
"release_account<plan_account and days<duration"
)
->
select
();
foreach
(
$esop_plan_list
as
$k
=>
$v
)
{
//更加明细记录判断执行的当天是否已释放过
$esop_plan_record_today
=
EsopPlanRecordModel
::
where
(
"FROM_UNIXTIME(create_time,'%Y-%m-%d')=curdate()"
)
->
where
([
'type'
=>
1
,
'esop_plan_id'
=>
$v
[
'id'
]])
->
find
();
if
(
!
$esop_plan_record_today
)
{
//计算释放期权金额
$affect
=
intval
(
$v
[
'plan_account'
]
/
$v
[
'duration'
]);
//如果是最后一天,取余数
if
(
$v
[
'duration'
]
-
$v
[
'days'
]
==
1
)
{
$affect
=
$v
[
'plan_account'
]
%
$v
[
'duration'
];
}
//释放期权,更新期权表
$updateData
=
[
'account'
=>
$v
[
'account'
]
+
$affect
,
'days'
=>
$v
[
'days'
]
+
1
,
'remain_account'
=>
$v
[
'plan_account'
]
-
$affect
,
'release_account'
=>
$v
[
'release_account'
]
+
$affect
];
EsopPlanModel
::
where
([
'id'
=>
$v
[
'id'
]])
->
update
(
$updateData
);
//写入明细表
$arr
=
[
'mid'
=>
$v
[
'mid'
],
'stock_id'
=>
$v
[
'stock_id'
],
'esop_plan_id'
=>
$v
[
'id'
],
'affect'
=>
$affect
,
'surplus'
=>
$v
[
'account'
]
+
$affect
,
'heatos'
=>
1
,
'type'
=>
1
,
'info'
=>
"自动行权,期权增加"
.
(
$affect
/
100
),
'create_time'
=>
time
(),
'create_ip'
=>
get_client_ip
(
0
)
];
EsopPlanRecordModel
::
create
(
$arr
);
}
}
}
}
application/apicom/home/Withdraw.php
View file @
ce05fe6f
...
...
@@ -64,8 +64,9 @@ class Withdraw extends Common
$rule
=
[];
$rule
[
0
]
=
"1.单笔提现最低金额:"
.
$minimum
;
$rule
[
1
]
=
"2.单笔提现最高金额:"
.
$maximum
;
$rule
[
2
]
=
"3.提现手续费"
.
$rate
.
"%"
;
$rule
[
4
]
=
"4.提现审核时间"
.
$withdraw_audit_time
;
$rule
[
2
]
=
"3.提现金额必须是最低金额的整数倍"
;
$rule
[
3
]
=
"4.提现手续费"
.
$rate
.
"%"
;
$rule
[
4
]
=
"5.提现审核时间"
.
$withdraw_audit_time
;
ajaxmsg
(
'提现规则说明'
,
1
,
$rule
);
}
/*
...
...
application/money/admin/Esopplan.php
View file @
ce05fe6f
...
...
@@ -80,9 +80,12 @@ class Esopplan extends Admin
// 保存数据
if
(
$this
->
request
->
isPost
())
{
$data
=
$this
->
request
->
post
();
if
(
$data
[
'duration'
]
<
1000
)
{
$this
->
error
(
"最低释放天数为1000天"
);
}
$data
[
'create_time'
]
=
time
();
$data
[
'plan_account'
]
=
$data
[
'plan_account'
]
*
100
;
$data
[
'remain_account'
]
=
$data
[
'plan_account'
]
*
100
;
$data
[
'remain_account'
]
=
$data
[
'plan_account'
];
$data
[
'create_ip'
]
=
get_client_ip
(
0
);
//业务逻辑处理
$result_up
=
Db
::
name
(
"esop_plan"
)
->
insert
(
$data
);
...
...
@@ -97,7 +100,7 @@ class Esopplan extends Admin
->
setPageTitle
(
'新增'
)
// 设置页面标题
->
addFormItems
([
// 批量添加表单项
[
'select:5'
,
'mid'
,
'请选择用户'
,
''
,
MemberModel
::
getMemberList
(),
''
,
url
(
'get_mid'
),
'mid'
],
[
'select:5'
,
'stock_id'
,
'请选择股票'
,
''
,
StockListModel
::
getStockList
(),
''
,
url
(
'get_stock_id'
),
'stock_id'
],
[
'select:5'
,
'stock_id'
,
'请选择股票'
,
''
,
StockListModel
::
get
Esop
StockList
(),
''
,
url
(
'get_stock_id'
),
'stock_id'
],
[
'number'
,
'plan_account'
,
'期权总值'
,
'期权总的价值(港元)'
,
'0'
],
[
'number'
,
'duration'
,
'总释放天数'
,
'总释放天数'
,
'1000'
],
[
'datetime'
,
'release_time'
,
'开始时间'
,
'从哪天开始释放期权'
,
''
,
'YYYY-MM-DD HH:mm:ss'
],
...
...
application/money/admin/Esopplanrecord.php
View file @
ce05fe6f
...
...
@@ -68,54 +68,5 @@ class EsopplanRecord extends Admin
->
fetch
();
// 渲染模板
}
/**
* 自动任务,根据设定的期权计划执行释放期权
*/
public
function
releaseEsop
()
{
$where
=
[];
//正在执行的期权计划
$where
[
'status'
]
=
1
;
//开始释放期权日期不大于当前日期
$where
[
'release_time'
]
=
[
'<='
,
date
(
"Y-m-d"
)];
//待行权值大于0
$where
[
'remain_account'
]
=
[
'>'
,
0
];
//已释放天数小于总天数,已释放期权小于期权总值
$esop_plan_list
=
EsopPlanModel
::
where
(
$where
)
->
where
(
"release_account<plan_account and days<duration"
)
->
select
();
foreach
(
$esop_plan_list
as
$k
=>
$v
)
{
//更加明细记录判断执行的当天是否已释放过
$esop_plan_record_today
=
EsopPlanRecordModel
::
where
(
"FROM_UNIXTIME(create_time,'%Y-%m-%d')=curdate()"
)
->
where
([
'type'
=>
1
,
'esop_plan_id'
=>
$v
[
'id'
]])
->
find
();
if
(
!
$esop_plan_record_today
)
{
//计算释放期权金额
$affect
=
intval
(
$v
[
'plan_account'
]
/
$v
[
'duration'
]);
//如果是最后一天,取余数
if
(
$v
[
'duration'
]
-
$v
[
'days'
]
==
1
)
{
$affect
=
$v
[
'plan_account'
]
%
$v
[
'duration'
];
}
//释放期权,更新期权表
$updateData
=
[
'account'
=>
$v
[
'account'
]
+
$affect
,
'days'
=>
$v
[
'days'
]
+
1
,
'remain_account'
=>
$v
[
'plan_account'
]
-
$affect
,
'release_account'
=>
$v
[
'release_account'
]
+
$affect
];
EsopPlanModel
::
where
([
'id'
=>
$v
[
'id'
]])
->
update
(
$updateData
);
//写入明细表
$arr
=
[
'mid'
=>
$v
[
'mid'
],
'stock_id'
=>
$v
[
'stock_id'
],
'esop_plan_id'
=>
$v
[
'id'
],
'affect'
=>
$affect
,
'surplus'
=>
$v
[
'account'
]
+
$affect
,
'heatos'
=>
1
,
'type'
=>
1
,
'info'
=>
"自动行权,期权增加"
.
(
$affect
/
100
),
'create_time'
=>
time
(),
'create_ip'
=>
get_client_ip
(
0
)
];
EsopPlanRecordModel
::
create
(
$arr
);
}
}
}
}
application/money/admin/Withdraw.php
View file @
ce05fe6f
...
...
@@ -14,8 +14,9 @@ namespace app\money\admin;
use
app\admin\controller\Admin
;
use
app\common\builder\ZBuilder
;
use
app\money\model\Withdraw
as
WithdrawModel
;
use
app\money\model\EsopPlan
as
EsopPlanModel
;
use
think\Db
;
use
think\Hook
;
use
think\Hook
;
use
think\Cache
;
/**
...
...
@@ -37,39 +38,37 @@ class Withdraw extends Admin
$noCheck
=
$this
->
request
->
get
(
'noCheck'
);
if
(
isset
(
$noCheck
))
{
$map
[
'money_withdraw.status'
]
=
$noCheck
;
if
(
isset
(
$noCheck
))
{
$map
[
'money_withdraw.status'
]
=
$noCheck
;
}
$order
=
$this
->
getOrder
();
empty
(
$order
)
&&
$order
=
'id desc'
;
// 数据列表
$data_list
=
WithdrawModel
::
getAll
(
$map
,
$order
);
// 分页数据
// 分页数据
$page
=
$data_list
->
render
();
if
(
empty
(
$_SERVER
[
"QUERY_STRING"
])){
$excel_url
=
substr
(
http
()
.
$_SERVER
[
"SERVER_NAME"
]
.
$_SERVER
[
"REQUEST_URI"
],
0
,
-
5
)
.
"_export"
;
}
else
{
$excel_url
=
substr
(
http
()
.
$_SERVER
[
"SERVER_NAME"
]
.
$_SERVER
[
"PHP_SELF"
],
0
,
-
5
)
.
"_export?"
.
$_SERVER
[
"QUERY_STRING"
];
if
(
empty
(
$_SERVER
[
"QUERY_STRING"
]))
{
$excel_url
=
substr
(
http
()
.
$_SERVER
[
"SERVER_NAME"
]
.
$_SERVER
[
"REQUEST_URI"
],
0
,
-
5
)
.
"_export"
;
}
else
{
$excel_url
=
substr
(
http
()
.
$_SERVER
[
"SERVER_NAME"
]
.
$_SERVER
[
"PHP_SELF"
],
0
,
-
5
)
.
"_export?"
.
$_SERVER
[
"QUERY_STRING"
];
}
$btn_excel
=
[
'title'
=>
'导出EXCEL表'
,
'icon'
=>
'fa fa-fw fa-download'
,
'href'
=>
url
(
$excel_url
,
''
,
''
)
'href'
=>
url
(
$excel_url
,
''
,
''
)
];
return
ZBuilder
::
make
(
'table'
)
->
setSearch
([
'order_no'
=>
'订单号'
,
'member.name'
=>
'姓名'
,
'member.mobile'
=>
'手机号'
])
// 设置搜索框
->
setSearch
([
'order_no'
=>
'订单号'
,
'member.name'
=>
'姓名'
,
'member.mobile'
=>
'手机号'
])
// 设置搜索框
->
addColumns
([
// 批量添加数据列
[
'order_no'
,
'订单号'
],
[
'mobile'
,
'手机号'
],
[
'name'
,
'姓名'
],
[
'money'
,
'申请金额'
],
[
'fee'
,
'手续费'
],
[
'real_money'
,
'到账金额'
],
[
'fee'
,
'手续费'
],
[
'real_money'
,
'到账金额'
],
[
'bank'
,
'银行信息'
],
[
'status'
,
'状态'
],
[
'create_time'
,
'申请时间'
,
'datetime'
],
...
...
@@ -77,67 +76,74 @@ class Withdraw extends Admin
])
->
hideCheckbox
()
->
addTopButton
(
'custem'
,
$btn_excel
)
->
addRightButton
(
'edit'
,
[],
[
'area'
=>
[
'800px'
,
'90%'
],
'title'
=>
'提现审核'
])
// 批量添加右侧按钮
->
addTopButton
(
'custem'
,
$btn_excel
)
->
addRightButton
(
'edit'
,
[],
[
'area'
=>
[
'800px'
,
'90%'
],
'title'
=>
'提现审核'
])
// 批量添加右侧按钮
->
replaceRightButton
([
'status'
=>
'成功'
],
'<button class="btn btn-danger btn-xs" type="button" disabled>不可操作</button>'
)
->
addOrder
(
'id,create_time,status,money,order_no'
)
->
setRowList
(
$data_list
)
->
fetch
();
// 渲染模板
}
public
function
index_export
(){
public
function
index_export
()
{
$map
=
$this
->
getMap
();
$noCheck
=
$this
->
request
->
get
(
'noCheck'
);
if
(
isset
(
$noCheck
))
{
$map
[
'money_withdraw.status'
]
=
$noCheck
;
if
(
isset
(
$noCheck
))
{
$map
[
'money_withdraw.status'
]
=
$noCheck
;
}
$order
=
$this
->
getOrder
();
empty
(
$order
)
&&
$order
=
'id desc'
;
// 数据列表
$xlsData
=
WithdrawModel
::
getAll
(
$map
,
$order
);
//$type_arr=['transfer'=>"线下转账","alipay"=>"支付宝"];
foreach
(
$xlsData
as
$k
=>
$v
)
{
// $v['type']=$type_arr[$v['type']];
//$type_arr=['transfer'=>"线下转账","alipay"=>"支付宝"];
foreach
(
$xlsData
as
$k
=>
$v
)
{
// $v['type']=$type_arr[$v['type']];
// $v['status']=$status_arr[$v['status']];
$xlsData
[
$k
][
'create_times'
]
=
date
(
'Y-m-d H:i:s'
,
$v
[
"create_time"
]);
$xlsData
[
$k
][
'create_times'
]
=
date
(
'Y-m-d H:i:s'
,
$v
[
"create_time"
]);
}
$title
=
"提现管理"
;
$arrHeader
=
array
(
'订单号'
,
'手机号'
,
'姓名'
,
'金额'
,
'银行信息'
,
'状态'
,
'申请时间'
);
$fields
=
array
(
'order_no'
,
'mobile'
,
'name'
,
'money'
,
'bank'
,
'status'
,
'create_times'
);
export
(
$arrHeader
,
$fields
,
$xlsData
,
$title
);
$title
=
"提现管理"
;
$arrHeader
=
array
(
'订单号'
,
'手机号'
,
'姓名'
,
'金额'
,
'银行信息'
,
'状态'
,
'申请时间'
);
$fields
=
array
(
'order_no'
,
'mobile'
,
'name'
,
'money'
,
'bank'
,
'status'
,
'create_times'
);
export
(
$arrHeader
,
$fields
,
$xlsData
,
$title
);
}
public
function
edit
(
$id
=
null
)
{
if
(
$id
===
null
)
$this
->
error
(
'缺少参数'
,
null
,
'_close_pop'
);
if
(
$id
===
null
)
$this
->
error
(
'缺少参数'
,
null
,
'_close_pop'
);
// 保存数据
if
(
$this
->
request
->
isPost
())
{
$data
=
$this
->
request
->
post
();
$result
=
$this
->
validate
(
$data
,
'Withdraw.update'
);
// 验证失败 输出错误信息
if
(
true
!==
$result
)
$this
->
error
(
$result
);
$result_up
=
WithdrawModel
::
saveAudit
();
if
(
true
!==
$result_up
){
$this
->
error
(
$result_up
);
}
else
{
if
(
true
!==
$result
)
$this
->
error
(
$result
);
$money_withdraw
=
WithdrawModel
::
where
([
'id'
=>
$data
[
'id'
]])
->
find
();
if
(
strpos
(
$money_withdraw
[
'order_no'
],
'estx'
))
{
//余额提现审核
$result_up
=
WithdrawModel
::
saveAudit
();
}
else
{
//期权提现审核
$result_up
=
EsopPlanModel
::
saveAudit
();
}
if
(
true
!==
$result_up
)
{
$this
->
error
(
$result_up
);
}
else
{
$this
->
success
(
'审核处理成功'
,
null
,
'_parent_reload'
);
}
}
}
$info
=
WithdrawModel
::
where
(
'id'
,
$id
)
->
find
();
// dump($info);exit;
$ishides
=
''
;
$ishides
=
''
;
$info
->
money
=
money_convert
(
$info
->
money
);
if
(
$info
->
getData
(
'status'
)
==
0
)
{
$status_arr
=
[
1
=>
'成功'
,
2
=>
'失败'
];
}
elseif
(
$info
->
getData
(
'status'
)
==
1
)
{
$status_arr
=
[
3
=>
'退回'
];
}
else
{
$status_arr
=
[
2
=>
'失败'
];
if
(
$info
->
getData
(
'status'
)
==
0
)
{
$status_arr
=
[
1
=>
'成功'
,
2
=>
'失败'
];
}
elseif
(
$info
->
getData
(
'status'
)
==
1
)
{
$status_arr
=
[
3
=>
'退回'
];
}
else
{
$status_arr
=
[
2
=>
'失败'
];
}
if
(
$info
->
getData
(
'status'
)
==
2
)
{
if
(
$info
->
getData
(
'status'
)
==
2
)
{
return
ZBuilder
::
make
(
'form'
)
->
setPageTitle
(
'提现审核'
)
// 设置页面标题
->
setPageTitle
(
'提现审核'
)
// 设置页面标题
->
addFormItems
([
// 批量添加表单项
[
'hidden'
,
'id'
],
[
'static'
,
'order_no'
,
'订单号'
],
...
...
@@ -147,11 +153,11 @@ class Withdraw extends Admin
[
'textarea'
,
'remark'
,
'备注'
,
''
]
])
->
hideBtn
(
'submit'
)
->
setFormData
(
$info
)
// 设置表单数据
->
setFormData
(
$info
)
// 设置表单数据
->
fetch
();
}
else
{
}
else
{
return
ZBuilder
::
make
(
'form'
)
->
setPageTitle
(
'提现审核'
)
// 设置页面标题
->
setPageTitle
(
'提现审核'
)
// 设置页面标题
->
addFormItems
([
// 批量添加表单项
[
'hidden'
,
'id'
],
[
'static'
,
'order_no'
,
'订单号'
],
...
...
@@ -160,10 +166,8 @@ class Withdraw extends Admin
[
'radio'
,
'status'
,
'状态'
,
''
,
$status_arr
],
[
'textarea'
,
'remark'
,
'备注'
,
''
]
])
->
setFormData
(
$info
)
// 设置表单数据
->
setFormData
(
$info
)
// 设置表单数据
->
fetch
();
}
}
}
\ No newline at end of file
}
application/money/model/EsopPlan.php
View file @
ce05fe6f
...
...
@@ -7,6 +7,7 @@ use app\money\model\Role as RoleModel;
use
app\money\model\EsopPlanRecord
as
EsopPlanRecordModel
;
use
app\money\model\Withdraw
as
MoneyWithdrawModel
;
use
app\member\model\Bank
as
BankModel
;
use
app\money\model\Record
;
use
app\member\model\MemberMessage
as
MemberMessageModel
;
use
think\model
;
use
think\Db
;
...
...
@@ -42,7 +43,7 @@ class EsopPlan extends Model
*/
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'
)
$esop_plan_list
=
self
::
view
(
'esop_plan ep'
,
'id,mid,account,plan_account,release_account,remain_account,release_time
,duration,days
'
)
->
view
(
"stock_list sl"
,
'title,code'
,
'sl.id=ep.stock_id'
,
'left'
)
->
field
([
"CONCAT(ROUND(release_account / plan_account * 100, 2), ' % ')"
=>
'accuracy'
])
->
field
([
"FROM_UNIXTIME(ep.create_time,'%Y-%m-%d %T')"
=>
'create_time'
])
...
...
@@ -53,7 +54,7 @@ class EsopPlan extends Model
return
$esop_plan_list
;
}
/**
* 期权提现
* 期权提现
申请
*/
public
static
function
esopWithdraw
(
$parameter
)
{
...
...
@@ -66,14 +67,14 @@ class EsopPlan extends Model
$data
[
'bank'
]
=
$bank
[
'bank'
]
.
"|"
.
$bank
[
'card'
]
.
'|'
.
$bank
[
'province'
]
.
$bank
[
'city'
]
.
$bank
[
'branch'
]
.
"|"
.
$names
[
'name'
];
$data
[
'mid'
]
=
$parameter
[
'mid'
];
$data
[
'money'
]
=
$parameter
[
'money'
]
*
100
;
$data
[
'fee'
]
=
$parameter
[
'money'
]
*
100
*
config
(
'withdraw_rate'
);
$data
[
'order_no'
]
=
'tx'
.
generate_rand_str
(
10
,
3
);
$data
[
'fee'
]
=
$parameter
[
'money'
]
*
config
(
'withdraw_rate'
);
$data
[
'order_no'
]
=
'
es
tx'
.
generate_rand_str
(
10
,
3
);
$data
[
'create_time'
]
=
time
();
$data
[
'create_ip'
]
=
get_client_ip
(
0
);
Db
::
startTrans
();
//查看当前期权的信息
$money_info
=
self
::
where
([
'id'
=>
$
data
[
'esop_plan_id'
]])
->
find
();
$money_info
=
self
::
where
([
'id'
=>
$
parameter
[
'esop_plan_id'
]])
->
find
();
//计算余额
$account
=
bcsub
(
$money_info
[
'account'
],
$data
[
'money'
]);
...
...
@@ -82,8 +83,9 @@ class EsopPlan extends Model
//写入期权变化明细表
$arr
=
[
'mid'
=>
$parameter
[
'mid'
],
'stock_id'
=>
$
parameter
[
'stock_id'
],
'stock_id'
=>
$
money_info
[
'stock_id'
],
'esop_plan_id'
=>
$parameter
[
'esop_plan_id'
],
'stock_trust_id'
=>
0
,
'affect'
=>
$parameter
[
'money'
],
'surplus'
=>
$account
,
'heatos'
=>
-
1
,
...
...
@@ -94,7 +96,7 @@ class EsopPlan extends Model
];
$res2
=
EsopPlanRecordModel
::
create
(
$arr
);
//更新期权信息
$res3
=
self
::
where
(
'id'
,
$parameter
[
'esop_plan_id'
])
->
update
(
'account'
,
$account
);
$res3
=
self
::
where
(
'id'
,
$parameter
[
'esop_plan_id'
])
->
update
(
[
'account'
=>
$account
]
);
if
(
$res1
&&
$res2
&&
$res3
)
{
Db
::
commit
();
return
[
'status'
=>
1
,
'message'
=>
'提交成功'
];
...
...
@@ -107,4 +109,110 @@ class EsopPlan extends Model
return
[
'status'
=>
0
,
'message'
=>
'数据异常'
];
}
}
/**
* 提现审核信息保存
* @return [type] [description]
*/
public
static
function
saveAudit
()
{
$res1
=
$res2
=
$res3
=
true
;
$status
=
input
(
'post.status'
);
$id
=
input
(
'post.id'
);
$remark
=
input
(
'post.remark'
);
if
(
!
$id
)
{
return
false
;
}
$withdraw
=
Db
(
'money_withdraw'
)
->
where
(
'id'
,
$id
)
->
find
();
$user_mobile
=
Db
(
'member'
)
->
where
(
'id'
,
$withdraw
[
'mid'
])
->
value
(
'mobile'
);
$up_withdraw
[
'status'
]
=
$status
;
$up_withdraw
[
'id'
]
=
$id
;
Db
::
startTrans
();
try
{
$record
=
new
record
;
$money_info
=
Db
(
'esop_plan'
)
->
where
(
'id'
,
$withdraw
[
'esop_plan_id'
])
->
lock
(
true
)
->
find
();
if
(
$status
==
1
)
{
// 提现通过 减去冻结金额
MoneyWithdrawModel
::
sms_withdraw
(
'stock_withdraw_auditing_success'
,
$user_mobile
,
$withdraw
[
'money'
]);
$contents
=
"提现审核通过"
;
$info
=
"提现单号:"
.
$withdraw
[
'order_no'
];
$affect
=
$withdraw
[
'money'
];
$type
=
3
;
$account
=
$withdraw
[
'money'
]
/
100
;
$res1
=
true
;
}
elseif
(
$status
==
2
)
{
// 提现失败 解冻冻结金额
MoneyWithdrawModel
::
sms_withdraw
(
'stock_withdraw_auditing_fail'
,
$user_mobile
,
$withdraw
[
'money'
]);
$contents
=
"提现审核未通过"
;
$up_money
[
'account'
]
=
bcadd
(
$money_info
[
'account'
],
$withdraw
[
'money'
]);
$info
=
"退回金额"
.
(
$withdraw
[
'money'
]
/
100
)
.
"元,提现单号:"
.
$withdraw
[
'order_no'
];
$affect
=
$withdraw
[
'money'
];
$type
=
4
;
$account
=
$up_money
[
'account'
];
//更新期权表
$res1
=
self
::
where
([
'id'
=>
$withdraw
[
'esop_plan_id'
]])
->
update
([
'account'
=>
$account
]);
//写入期权变化明细表
$arr
=
[
'mid'
=>
$withdraw
[
'mid'
],
'stock_id'
=>
$money_info
[
'stock_id'
],
'esop_plan_id'
=>
$withdraw
[
'esop_plan_id'
],
'stock_trust_id'
=>
0
,
'affect'
=>
$withdraw
[
'money'
],
'surplus'
=>
$account
,
'heatos'
=>
-
1
,
'type'
=>
3
,
'info'
=>
"提现驳回,退回期权金额:"
.
(
$withdraw
[
'money'
]
/
100
),
'create_time'
=>
time
(),
'create_ip'
=>
get_client_ip
(
0
)
];
EsopPlanRecordModel
::
create
(
$arr
);
}
elseif
(
$status
==
3
)
{
// 提现退回 补充可用金额
$up_money
[
'account'
]
=
bcadd
(
$money_info
[
'account'
],
$withdraw
[
'money'
]);
$info
=
"退回金额"
.
(
$withdraw
[
'money'
]
/
100
)
.
"元,提现单号:"
.
$withdraw
[
'order_no'
];
$affect
=
$withdraw
[
'money'
];
$type
=
6
;
$account
=
$up_money
[
'account'
];
//更新期权表
$res1
=
self
::
where
([
'id'
=>
$withdraw
[
'esop_plan_id'
]])
->
update
([
'account'
=>
$account
]);
//写入期权变化明细表
$arr
=
[
'mid'
=>
$withdraw
[
'mid'
],
'stock_id'
=>
$money_info
[
'stock_id'
],
'esop_plan_id'
=>
$withdraw
[
'esop_plan_id'
],
'stock_trust_id'
=>
0
,
'affect'
=>
$withdraw
[
'money'
],
'surplus'
=>
$account
,
'heatos'
=>
-
1
,
'type'
=>
3
,
'info'
=>
"提现驳回,退回期权金额:"
.
(
$withdraw
[
'money'
]
/
100
),
'create_time'
=>
time
(),
'create_ip'
=>
get_client_ip
(
0
)
];
EsopPlanRecordModel
::
create
(
$arr
);
}
else
{
return
'状态有误'
;
}
//审核记录
$res3
=
$record
->
saveData
(
$withdraw
[
'mid'
],
$affect
,
$account
,
$type
,
$info
);
//更新提现记录
$res2
=
MoneyWithdrawModel
::
update
(
$up_withdraw
);
if
(
$res1
&&
$res2
&&
$res3
)
{
Db
::
commit
();
//添加站内信信息
$MemberMessageModel
=
new
MemberMessageModel
();
$MemberMessageModel
->
addInnerMsg
(
$withdraw
[
'mid'
],
'提现审核通知'
,
$contents
);
//站内信
}
else
{
Db
::
rollback
();
return
'数据更新失败'
;
}
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
$e
->
getMessage
();
}
$mobile
=
Db
(
'member'
)
->
where
(
'id'
,
$withdraw
[
'mid'
])
->
value
(
'mobile'
);
$details
=
$mobile
.
' 字段(status),原值:(0)新值:('
.
$status
.
') 备注:'
.
$remark
.
$info
;
action_log
(
'withdraw_edit'
,
'money_withdraw'
,
$id
,
UID
,
$details
);
return
true
;
}
}
application/money/model/Withdraw.php
View file @
ce05fe6f
...
...
@@ -38,7 +38,7 @@ class Withdraw extends Model
public
static
function
getAll
(
$map
=
[],
$order
=
''
)
{
$data_list
=
self
::
view
(
'money_withdraw'
,
'id,mid,order_no,money,fee,(money-fee) as real_money,status,create_time'
)
$data_list
=
self
::
view
(
'money_withdraw'
,
true
)
->
field
(
"(money_withdraw.money-money_withdraw.fee) as real_money"
)
->
view
(
'member'
,
'mobile, name, id_card'
,
'member.id=money_withdraw.mid'
,
'left'
)
->
where
(
$map
)
->
order
(
$order
)
...
...
@@ -46,6 +46,7 @@ class Withdraw extends Model
->
each
(
function
(
$item
,
$key
)
{
$item
->
money
=
money_convert
(
$item
->
money
);
$item
->
fee
=
money_convert
(
$item
->
fee
);
$item
->
real_money
=
money_convert
(
$item
->
real_money
);
});
return
$data_list
;
}
...
...
application/stock/model/StockList.php
View file @
ce05fe6f
...
...
@@ -39,4 +39,27 @@ class StockList extends Model
}
return
$list
;
}
/**
* 获取期权列表(下拉选择时使用)
* @param
* @author 路人甲乙
* @return mixed
*/
public
static
function
getEsopStockList
()
{
$list
=
[];
$where
[
'status'
]
=
1
;
$where
[
'id'
]
=
[
'in'
,
[
6263
,
6264
]];
$data_list
=
Db
::
name
(
'stock_list'
)
->
where
(
$where
)
->
column
(
true
,
'id'
);
if
(
!
is_null
(
$data_list
))
{
foreach
(
$data_list
as
$v
)
{
$list
[
$v
[
'id'
]]
=
$v
[
'title'
];
}
}
else
{
$list
=
[];
}
return
$list
;
}
}
plugins/SystemInfo/view/widget.html
View file @
ce05fe6f
<div
class=
"col-md-{$width|default=6}"
>
<div
class=
"block block-bordered"
>
<
!-- <
div class="block block-bordered">
<div class="block-header bg-gray-lighter">
<h3 class="block-title">系统信息</h3>
</div>
...
...
@@ -34,5 +34,5 @@
</tbody>
</table>
</div>
</div>
</div>
-->
</div>
\ No newline at end of file
plugins/waitingProcess/view/widget.html
View file @
ce05fe6f
...
...
@@ -6,7 +6,7 @@
<div
class=
"block-content"
>
<table
class=
"table"
>
<tbody>
<tr>
<!--
<tr>
<td>免息体验待审核</td>
<td><a href="__ROOT__/admin.php/stock/borrow/index?type=5">{$experience_apply}</a></td>
...
...
@@ -35,20 +35,20 @@
<td>充值待审核</td>
<td><a href="__ROOT__/admin.php/money/recharge/index.html">{$transfer_nodo}</a></td>
</tr>
<tr>
<td>
终止操盘
待审核
</td>
<td><a
href=
"__ROOT__/admin.php/stock/borrow/stop.html"
>
{$advance_termination_apply_count
}
</a></td>
<td>
提现待审核
</td>
<td><a
href=
"__ROOT__/admin.php/money/withdraw/index?noCheck=0"
>
{$withdraw_noDo}
</a></td>
</tr>
<tr>
</tr>
-->
<tr>
<td>
实名认证
待审核
</td>
<td><a
href=
"__ROOT__/admin.php/member/identity/index.html"
>
{$idAuth_noDo
}
</a></td>
<td>
提现待审核
</td>
<td><a
href=
"__ROOT__/admin.php/money/withdraw/index?noCheck=0"
>
{$withdraw_noDo}
</a></td>
</tr>
<!--
<tr>
<td>到期配资待结算</td>
<td><a href="__ROOT__/admin.php/stock/borrow/endlist.html">{$expire_stock_count} </a></td>
<td>
实名认证待审核
</td>
<td><a
href=
"__ROOT__/admin.php/
member/identity/index.html"
>
{$idAuth_noDo
}
</a></td>
</tr>
<td>
终止操盘待审核</td>
<td><a href="__ROOT__/admin.php/
stock/borrow/stop.html">{$advance_termination_apply_count
}</a></td>
</tr>
-->
</tbody>
</table>
</div>
...
...
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