|
@@ -48,60 +48,27 @@ class My extends Core
|
|
|
{
|
|
|
$this->data['list'] = Dever::load('option/lib/cash')->getList($this->uid, 'jiaofu', 2, '待交付');
|
|
|
|
|
|
- return $this->data;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public function setValue_commit()
|
|
|
- {
|
|
|
- $id = Dever::input('id');
|
|
|
- if (!$id) {
|
|
|
- Dever::alert('错误的期权交付记录');
|
|
|
- }
|
|
|
-
|
|
|
- $info = Dever::db('option/bill_jiaofu')->find($id);
|
|
|
-
|
|
|
- if (!$info) {
|
|
|
- Dever::alert('错误的期权交付记录');
|
|
|
- }
|
|
|
-
|
|
|
- if ($info['aid'] != $this->uid) {
|
|
|
- Dever::alert('错误的期权交付记录');
|
|
|
- }
|
|
|
-
|
|
|
- if ($info['status'] != 2) {
|
|
|
- Dever::alert('已确认该交付记录');
|
|
|
- }
|
|
|
-
|
|
|
- $state = Dever::db('option/bill_jiaofu')->update(array('status' => 1, 'where_id' => $id));
|
|
|
-
|
|
|
- if ($state) {
|
|
|
- $cash = Dever::db('option/cash')->find(array('type' => $info['type'], 'aid' => $this->uid));
|
|
|
- if ($cash) {
|
|
|
- $update['where_id'] = $cash['id'];
|
|
|
- $update['daijiaofu'] = $cash['daijiaofu'] - $info['cash'];
|
|
|
- $update['jiaofu'] = $cash['jiaofu'] + $info['cash'];
|
|
|
- if ($update['daijiaofu'] < 0) {
|
|
|
- $update['daijiaofu'] = 0;
|
|
|
- }
|
|
|
- Dever::db('option/cash')->update($update);
|
|
|
-
|
|
|
-
|
|
|
- $fafang = Dever::db('option/bill_fafang')->find(array('status' => 2, 'aid' => $this->uid));
|
|
|
- if ($fafang) {
|
|
|
- foreach ($fafang as $k => $v) {
|
|
|
- if ($info['cash'] >= $v['cash']) {
|
|
|
- Dever::db('option/bill_fafang')->update(array('where_id' => $v['id'], 'status' => 1));
|
|
|
- $info['cash'] -= $v['cash'];
|
|
|
- }
|
|
|
- }
|
|
|
+ $audit = array
|
|
|
+ (
|
|
|
+ 'status' => 1,
|
|
|
+ 'desc' => '',
|
|
|
+ );
|
|
|
+ if ($this->data['list']) {
|
|
|
+ foreach ($this->data['list'] as $k => $v) {
|
|
|
+ if ($v['audit'] == 4) {
|
|
|
+ $audit['status'] = 4;
|
|
|
+ $audit['desc'] = $v['audit_desc'];
|
|
|
+ break;
|
|
|
+ } elseif ($v['audit'] == 2) {
|
|
|
+ $audit['status'] = 2;
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
- return 'ok';
|
|
|
}
|
|
|
- } else {
|
|
|
- Dever::alert('操作失败');
|
|
|
}
|
|
|
+
|
|
|
+ $this->data['audit'] = $audit;
|
|
|
+
|
|
|
+ return $this->data;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -192,36 +159,47 @@ class My extends Core
|
|
|
if ($where) {
|
|
|
$where['where_id'] = $this->uid;
|
|
|
$where['audit'] = 2;
|
|
|
+ $where['status'] = 2;
|
|
|
$where['is_idcard'] = 1;
|
|
|
Dever::db('option/account')->update($where);
|
|
|
}
|
|
|
|
|
|
+ if ($where['is_email'] == 2) {
|
|
|
+ $code = Dever::load('passport/reg')->code(false, false);
|
|
|
+ $email = base64_encode($where['email']);
|
|
|
+ Dever::daemon('lib/email.renzheng?aid='.$this->uid.'&email=' . $email . '&code=' . $code . '&username=' . $this->user['name'], 'option');
|
|
|
+ }
|
|
|
+
|
|
|
return Dever::db('option/account')->find(array('id' => $this->uid, 'clear' => true));
|
|
|
}
|
|
|
|
|
|
|
|
|
public function act_commit()
|
|
|
{
|
|
|
- $where['sign'] = Dever::input('sign');
|
|
|
- if (!$where['sign']) {
|
|
|
+ $update['sign'] = Dever::input('sign');
|
|
|
+ if (!$update['sign']) {
|
|
|
Dever::alert('请上传签名');
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- $this->user['sign'] = $where['sign'];
|
|
|
- Dever::load('option/lib/agreement')->up($this->user);
|
|
|
-
|
|
|
- $where['where_id'] = $this->uid;
|
|
|
- $where['status'] = 2;
|
|
|
- $where['is_sign'] = 1;
|
|
|
- Dever::db('option/account')->update($where);
|
|
|
-
|
|
|
- $email = $this->user['email'];
|
|
|
-
|
|
|
- $code = Dever::load('passport/reg')->code(false, false);
|
|
|
+ $data = Dever::load('option/lib/cash')->getList($this->uid, 'jiaofu', 2, '待交付');
|
|
|
+ if (!$data) {
|
|
|
+ Dever::alert('没有待交付的期权价值');
|
|
|
+ }
|
|
|
+ $ids = array();
|
|
|
+ $total = 0;
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ $ids[] = $v['id'];
|
|
|
+ $total += $v['cash'];
|
|
|
+ $update['where_id'] = $v['id'];
|
|
|
+ $update['audit'] = 2;
|
|
|
+ $update['qdate'] = time();
|
|
|
+ Dever::db('option/bill_jiaofu')->update($update);
|
|
|
+ }
|
|
|
+ $ids = implode(',', $ids);
|
|
|
|
|
|
- $email = base64_encode($email);
|
|
|
- Dever::daemon('lib/email.renzheng?aid='.$this->uid.'&email=' . $email . '&code=' . $code . '&username=' . $this->user['name'], 'option');
|
|
|
+
|
|
|
+ $this->user['sign'] = $update['sign'];
|
|
|
+ Dever::load('option/lib/agreement')->up($this->user, $ids, $total);
|
|
|
|
|
|
return $this->user;
|
|
|
}
|
|
@@ -232,6 +210,29 @@ class My extends Core
|
|
|
return 'test';
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function getAgreement()
|
|
|
+ {
|
|
|
+ $where['aid'] = $this->uid;
|
|
|
+ $this->data['list'] = Dever::db('option/agreement')->getAll($where);
|
|
|
+
|
|
|
+ if ($this->data['list']) {
|
|
|
+ $status = Dever::db('option/agreement')->config['status'];
|
|
|
+ foreach ($this->data['list'] as $k => $v) {
|
|
|
+ $this->data['list'][$k]['status_name'] = $status[$v['status']];
|
|
|
+ $this->data['list'][$k]['qdate_string'] = '';
|
|
|
+ if ($v['qdate']) {
|
|
|
+ $this->data['list'][$k]['qdate_string'] = date('Y.m.d', $v['qdate']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $name = Dever::load('option/lib/agreement')->name($v['agreement_id'], $v, 2, 2);
|
|
|
+ $this->data['list'][$k]['link'] = $name[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->data;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function getAgreementView()
|
|
|
{
|