Commit d6760c79 authored by twj's avatar twj

增加股权隐藏功能

parent adff3f4e
......@@ -20,6 +20,8 @@ class Esop extends Common
// 获取查询条件
$map = $this->getMap();
$map['mid'] = MID;
//除去冻结期权
$map['status'] = 1;
$order = 'id desc';
$page = intval($this->request->param("page"));
$page = $page ? $page : 1;
......@@ -37,7 +39,7 @@ class Esop extends Common
}
/**
* 期权计划
* 期权变化明细
* @return [type] [description]
*/
public function getEsopPlanRecordList()
......@@ -57,15 +59,16 @@ class Esop extends Common
$offset = $page;
// 数据列表
$data_list = EsopPlanRecordModel::getEsopPlanRecordList($map, $order, $offset, 15);
foreach ($data_list as $k => $v) {
$data_list[$k]['affect'] = bcdiv($v['affect'], 100, 2);
$data_list[$k]['surplus'] = bcdiv($v['surplus'], 100, 2);
$data_list[$k]['type'] = getTypeNameForEsop($v['type']);
$data_list[$k]['stock'] = [];
if ($v['stock_trust_id']) {
if ($data_list) {
foreach ($data_list as $k => $v) {
$data_list[$k]['affect'] = bcdiv($v['affect'], 100, 2);
$data_list[$k]['surplus'] = bcdiv($v['surplus'], 100, 2);
$data_list[$k]['type'] = getTypeNameForEsop($v['type']);
$data_list[$k]['stock'] = [];
if ($v['stock_trust_id']) {
}
}
}
ajaxmsg('数据列表', 1, $data_list);
}
/**
......@@ -104,7 +107,7 @@ class Esop extends Common
//期权计划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']) {
ajaxmsg('请选择要提现的期权!', 0);
}
......@@ -118,18 +121,20 @@ class Esop extends Common
}
//判断是否是最低金额的整数倍
$minimum = config('withdraw_minimum');
if ($data['money'] % $minimum != 0) {
ajaxmsg('提现金额必须是最低金额的整数倍!', 0);
if ($data['money'] < $minimum) {
ajaxmsg('最低提现金额为' . $minimum, 0);
}
if ($data['money'] % 500 != 0) {
ajaxmsg('提现金额必须是500的整数倍!', 0);
}
//校验当前期权计划余额
$money_res = EsopPlanModel::where(['id' => $data['esop_plan_id']])->find();
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']) {
ajaxmsg('提现金额已经大于可用余额!', 0);
}
$data['stock_id'] = $money_res['stock_id'];
//查询是否已申请过提现,一次只能有一笔提现
$withdraw_info = Db::name('money_withdraw')
->where(['mid' => MID])
......@@ -180,10 +185,10 @@ class Esop extends Common
$updateData = [
'account' => $v['account'] + $affect,
'days' => $v['days'] + 1,
'remain_account' => $v['plan_account'] - $affect,
'remain_account' => $v['remain_account'] - $affect,
'release_account' => $v['release_account'] + $affect
];
EsopPlanModel::where(['id' => $v['id']])->update($updateData);
EsopPlanModel::where(['id' => $v['id']])->update($updateData);
//写入明细表
$arr = [
'mid' => $v['mid'],
......
......@@ -43,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,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')
->field(["CONCAT(ROUND(release_account / plan_account * 100, 2), ' % ')" => 'accuracy'])
->field(["FROM_UNIXTIME(ep.create_time,'%Y-%m-%d %T')" => 'create_time'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment