Commit 261f66b8 by 冷斌

踢人

parent 31e4675a
......@@ -39,6 +39,7 @@
<th>兑换{$configpub['name_votes']}</th>
<th>提现金额</th>
<th>提现账号</th>
<th>来源</th>
<!-- <th>商户订单号</th> -->
<th>第三方支付订单号</th>
<th>状态</th>
......@@ -59,6 +60,7 @@
{$type[$vo['type']]}<br>{$vo['name']}<br>{$vo['account']}<br>{$vo['account_bank']}
</td>
<!-- <td>{$vo['orderno']}</td> -->
<td>{$source[$vo['source']]}</td>
<td>{$vo['trade_no']}</td>
<td>{$status[$vo['status']]}</td>
<td>{$vo.addtime|date="Y-m-d H:i:s",###}</td>
......
......@@ -97,6 +97,7 @@ class Api_User extends PhalApi_Api {
'token' => array('name' => 'token', 'type' => 'string', 'require' => true, 'desc' => '用户token'),
'accountid' => array('name' => 'accountid', 'type' => 'int', 'require' => true, 'desc' => '账号ID'),
'cashvote' => array('name' => 'cashvote', 'type' => 'int', 'require' => true, 'desc' => '提现的票数'),
'source' => array('name' => 'type', 'type' => 'int', 'require' => true, 'desc' => '类型,1主播,2邀请,3家族'),
),
'setAttent' => array(
......@@ -966,6 +967,8 @@ class Api_User extends PhalApi_Api {
'uid'=>$uid,
'accountid'=>$accountid,
'cashvote'=>$cashvote,
'type' => $this->type,
'source' => $this->source,
);
$config=getConfigPri();
$domain = new Domain_User();
......
......@@ -164,6 +164,7 @@ class Model_User extends PhalApi_Model_NotORM
$uid = $data['uid'];
$accountid = $data['accountid'];
$money = $data['cashvote'];
$source = $data['source'];
$config = getConfigPri();
$cash_start = $config['cash_start'];
......@@ -223,7 +224,20 @@ class Model_User extends PhalApi_Model_NotORM
$cashvotes = $money * $cash_rate;
$ifok = false;
if ($source == 1) {
$ifok = DI()->notorm->users->where('id = ? and votes>=?', $uid, $cashvotes)->update(['votes' => new NotORM_Literal("votes - {$cashvotes}")]);
}
if ($source == 2) {
$ifok = DI()->notorm->users->where('id = ? and i_votes>=?', $uid, $cashvotes)->update(['i_votes' => new NotORM_Literal("i_votes - {$cashvotes}")]);
}
if ($source == 3) {
$ifok = DI()->notorm->users->where('id = ? and f_votes>=?', $uid, $cashvotes)->update(['f_votes' => new NotORM_Literal("f_votes - {$cashvotes}")]);
}
if (!$ifok) {
return 1001;
}
......
......@@ -70,6 +70,7 @@ class CashController extends AdminbaseController {
$this->assign('lists', $lists);
$this->assign('formget', $_GET);
$this->assign('type', $this->type);
$this->assign('source', [1 => '主播魅力', 2 => '邀请魅力', 3 => '家族魅力']);
$this->assign("page", $page->show('Admin'));
$this->display();
......
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