public static function cash_in($uid, $cash, $action, $source = null, $obj_type = null, $obj_id = null, $profit = 0, $charge = null) { $user_info = self::init($uid); $sys_config = self::$_basic_config; $fo = new Keke_witkey_finance_class(); $fo->setFina_action($action); $fo->setFina_type("in"); $fo->setObj_type($obj_type); $fo->setObj_id($obj_id); $fo->setFina_cash($cash); if (empty(self::$_mem)) { $action_arr = keke_glob_class::get_finance_action($action); self::$_mem = $action_arr[$action]; } $fo->setFina_mem(self::$_mem); $fo->setUser_balance($user_info['balance'] + $cash); $fo->setUid($user_info['uid']); $fo->setUsername($user_info['username']); $fo->setFina_source($source); $fo->setSite_profit($profit); $fo->setFina_mem(self::$_mem); $fo->setRecharge_cash($charge !== null ? floatval($charge) : null); $sql = "update " . TABLEPRE . "witkey_space set balance = ifnull(balance,0)+" . $cash . " where uid ='{$user_info['uid']}'"; $res = db_factory::execute($sql); if ($res) { $fo->setFina_time(time()); $row = $fo->create_keke_witkey_finance(); return $row; } else { return false; } }
public function review_auth($auth_ids, $type = 'pass', $url = null) { global $_lang; global $kekezu; if ($url === null) { $url = $_SERVER['HTTP_REFERER']; } $prom_obj = keke_prom_class::get_instance(); is_array($auth_ids) and $auth_ids = implode(",", $auth_ids); $auth_info = $this->get_auth_info($auth_ids); $size = sizeof($auth_info); $size > 0 && $type == 'pass' and $status = '1' or $status = '2'; $size == 0 and kekezu::admin_show_msg($this->auth_lang() . $_lang['apply_not_exist_audit_fail'], $_SERVER['HTTP_REFERER']); if ($size == 1 && $auth_info[0]['auth_status'] != '1') { $this->set_auth_status($auth_info[0][$this->_primary_key], $status); $this->set_auth_record_status($auth_info[0]['uid'], $status); $this->_auth_code == 'realname' && $status == 1 and $this->extract_birth($auth_info[0]['uid'], $auth_info[0]['id_card']); } elseif ($size > 1) { foreach ($auth_info as $v) { if ($v['auth_status'] != '1') { $this->set_auth_record_status($v['uid'], $status); $this->set_auth_status($v[$this->_primary_key], $status); $this->_auth_code == 'realname' && $status == 1 and $this->extract_birth($v['uid'], $v['id_card']); } } } switch ($type) { case "pass": kekezu::admin_system_log($this->auth_lang() . $_lang['apply_pass'] . "{$auth_ids}"); foreach ($auth_info as $v) { if ($this->_auth_code == 'enterprise') { $this->set_user_role($auth_info[0][uid], $type); } elseif ($this->_auth_code == 'realname') { $this->set_user_role($auth_info[0][uid], $type); } $feed_arr = array("feed_username" => array("content" => $v[username], "url" => "index.php?do=seller&id={$v['uid']}"), "action" => array("content" => $_lang['has_pass'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => "")); kekezu::save_feed($feed_arr, $v['uid'], $v['username'], $this->_auth_name); $prom_obj->dispose_prom_event('reg', $v['uid'], $v['uid']); $auth_arr = keke_glob_class::get_finance_action(); $arr[$_lang['auth_code']] = $auth_arr[$this->_auth_name]; $arr[$_lang['auth_url']] = "index.php?do=user&view=payitem&op=auth&auth_code={$this->_auth_code}"; keke_msg_class::notify_user($v['uid'], $v['username'], 'auth_success', $auth_arr[$this->_auth_name] . $_lang['through'], $arr, 2); } $url = 'HTTP://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?do=auth&view=list&code={$this->_auth_code}"; kekezu::admin_show_msg($this->auth_lang() . $_lang['apply_audit_success'], $url, 3, '', 'success'); break; case "not_pass": kekezu::admin_system_log($this->auth_lang() . $_lang['apply_not_pass'] . "{$auth_ids}"); kekezu::admin_show_msg($this->auth_lang() . $_lang['apply_audit_not_pass'], $url, 3, '', 'success'); break; } }
<?php defined('IN_KEKE') or exit('Access Denied'); $strUrl = "index.php?do=user&view=finance&op=details"; $intPagesize and $strUrl .= "&intPagesize=" . intval($intPagesize); $intFinaId and $strUrl .= " &intFinaId=" . intval($intFinaId); $strFinaType and $strUrl .= "&strFinaType=" . strval($strFinaType); $strOrder and $strUrl .= "&strOrder=" . strval($strOrder); $arrAction = keke_glob_class::get_finance_action(); $arrOrd = array('a.fina_id desc' => '财务编号降序', 'a.fina_id asc' => '财务编号升序', 'a.fina_time desc' => '支付时间降序', 'a.fina_time asc' => '支付时间升序'); $page and $intPage = intval($page); $intPage = intval($intPage) ? $intPage : 1; $intPagesize = intval($intPagesize) ? $intPagesize : 10; $strSql = ' select a.*,b.task_title,c.title from ' . TABLEPRE . 'witkey_finance a left join ' . TABLEPRE . 'witkey_task b on a.obj_id=b.task_id left join ' . TABLEPRE . 'witkey_service c on a.obj_id=c.service_id '; $strWhere = " where a.uid=" . intval($gUid) . " and a.fina_action not in ('withdraw','offline_recharge','offline_charge','online_charge','online_recharge','withdraw_fail')"; intval($intFinaId) and $strWhere .= " and a.fina_id = " . intval($intFinaId); $strFinaType and $strWhere .= " and a.fina_type = '{$strFinaType}' "; $strOrder && in_array($strOrder, array_keys($arrOrd)) and $strWhere .= " order by {$strOrder} " or $strWhere .= " order by a.fina_id desc "; $intCount = intval(db_factory::execute(sprintf($strSql . $strWhere, TABLEPRE))); $strPages = $page_obj->getPages($intCount, $intPagesize, $intPage, $strUrl, '#userCenter'); $arrFinanceLists = db_factory::query($strSql . $strWhere . $strPages['where']);
$intFinaId and $w .= " and fina_id = '" . intval($intFinaId) . "' "; if ($type == 'in') { $w .= " and fina_type = 'in'"; } elseif ($type == 'out') { $w .= "and fina_type = 'out'"; } switch ($ord) { case 1: $w .= ' order by fina_id asc '; break; case 2: $w .= ' order by fina_id desc '; break; case 3: $w .= ' order by fina_time asc '; break; case 4: $w .= ' order by fina_time desc '; break; } $fina_action_arr = keke_glob_class::get_finance_action(); $strSql = "select fina_action,fina_id,fina_type,fina_cash,user_balance,fina_time from " . TABLEPRE . "witkey_finance where "; if (!$ord) { $w .= ' order by fina_time desc'; } $strSql .= $w; } $arrData = db_factory::query($strSql); $arrPageArr = $kekezu->_page_obj->page_by_arr($arrData, $pageSize, $page, $strUrl); $arrData = $arrPageArr['data']; $strPages = $arrPageArr['page'];