userId = $this->userid; $this->toady_count = db('user_cash')->where('status', '<>', '2')->where('user_id', $this->userId)->whereTime('create_time', 'today')->count(); $this->toady_money = db('user_cash')->where('status', '<>', '2')->where('user_id', $this->userId)->whereTime('create_time', 'today')->sum('money'); $this->month_count = db('user_cash')->where('status', '<>', '2')->where('user_id', $this->userId)->whereTime('create_time', 'month')->count(); $this->month_money = db('user_cash')->where('status', '<>', '2')->where('user_id', $this->userId)->whereTime('create_time', 'month')->sum('money'); } function cash_new() { $name = SafeRequest("name", "post"); if (!$name) { reJSON('请输入你的真实姓名'); } $account = SafeRequest("account", "post"); if (!$account) { reJSON('请输入你的提现账号'); } $money = SafeRequest("money", "post"); if (!is_numeric($money)) { reJSON('请输入你的提现金额'); } $type = SafeRequest("type", "post"); $user = db('user')->where('in_userid', $this->userid)->find(); if ($money < IN_CASH_MIN) { reJSON('单笔提现至少要' . IN_CASH_MIN . '元'); } if ($money > $user['promote_money']) { reJSON('你没有那么多的佣金'); } if ($money > IN_CASH_MAX) { reJSON('单笔提现不能大于' . IN_CASH_MAX . '元'); } if (IN_CASH_DAY > 0) { if ($this->toady_count >= IN_CASH_DAY) { reJSON('你今天提现次数已达' . IN_CASH_DAY . '次上限'); } } if (IN_CASH_DAY_MAX > 0) { if ($this->toady_money >= IN_CASH_DAY_MAX) { reJSON('你今天提现额度已达' . IN_CASH_DAY_MAX . '元上限'); } if ($this->toady_money + $money > IN_CASH_DAY_MAX) { reJSON('你今天提现额度仅剩' . (IN_CASH_DAY_MAX - $this->toady_money) . '元'); } } if (IN_CASH_MONTH > 0) { if ($this->month_count >= IN_CASH_MONTH) { reJSON('你本月提现次数已达' . IN_CASH_MONTH . '次上限'); } } if (IN_CASH_MONTH_MAX > 0) { if ($this->month_money >= IN_CASH_MONTH_MAX) { reJSON('你本月提现额度已达' . IN_CASH_MONTH_MAX . '元上限'); } if ($this->month_money + $money > IN_CASH_MONTH_MAX) { reJSON('你本月提现额度仅剩' . (IN_CASH_MONTH_MAX - $money) . '元'); } } $data = array('user_id' => $user['in_userid'], 'account' => $account, 'name' => $name, 'money' => $money, 'type' => $type ?: 1, 'create_time' => time()); $note = SafeRequest("note", "post"); $note && ($data['note'] = $note); $res = db('user_cash')->insert($data); $res = $res && aclog_save($user['in_userid'], $user['promote_money'] - $money, $user['promote_money'], 'promote_money', '佣金提现'); $res = $res && db('user')->where('in_userid', $this->userid)->dec('promote_money', $money)->update(); reJSON($res, $res, $res ? '提现申请已受理,请耐心等待处理结果' : '提现申请受理不成功,请稍后重试'); } function cancle() { $id = SafeRequest("id", "post"); $user = db('user')->where('in_userid', $this->userid)->find(); $clog = db('user_cash')->where('id', $id)->where('status', '<', '1')->find(); if (!$clog || !$user) { reJSON('提现记录存在错误'); } $res = aclog_save($user['in_userid'], $user['promote_money'] + $clog['money'], $user['promote_money'], 'promote_money', '取消提现返还'); $res = $res && db('user')->where('in_userid', $this->userid)->inc('promote_money', $clog['money'])->update(); $res = $res && db('user_cash')->where('id', $id)->update(array('status' => 2)); reJSON($res, $res, $res ? '取消提现成功' : '取消提现不成功,请稍后重试'); } function index() { $map = array(); $total = db('user_cash')->where($map)->where('user_id', $this->userid)->count(); $num = 10; $cpage = isset($_GET['page']) ? $_GET['page'] : 1; $pagenum = ceil($total / $num); $offset = ($cpage - 1) * $num; $result = db('user_cash')->where($map)->where('user_id', $this->userid)->order('id desc')->limit($offset, $num)->select(); $start = $offset + 1; $end = $cpage == $pagenum ? $total : $cpage * $num; $next = $cpage == $pagenum ? 0 : $cpage + 1; $prev = $cpage == 1 ? 0 : $cpage - 1; $IN_CASH_TYPE = json_decode(IN_CASH_TYPE, true); ?> 我的订单 - <?php echo IN_NAME;?> - 免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发 static_(); ?> header(); ?>
个人中心/账号信息
user_left(); ?>

佣金

user['promote_money'];?>

已提现佣金

user['promote_money_cash'];?>

user['promote_money'] > IN_CASH_MIN && isCashDate()) { ?> 提现
$value) { ?>
ID 姓名 账号 提现金额 提现方式 备注 提现时间 状态 操作
取消

暂无订单信息

footer(); ?>