public static function set_service_status($service_id, $service_status) { self::set_on_sale_num($service_id, $service_status); $service_obj = new Keke_witkey_service_class(); if (is_array($service_id)) { $service_arr = implode(',', array_unique($service_id)); $service_obj->setWhere('service_id in(' . $service_arr . ')'); } else { $service_obj->setWhere('service_id=' . $service_id); } $service_obj->setService_status($service_status); $res = $service_obj->edit_keke_witkey_service(); if ($res && $service_status) { if (is_array($service_id)) { foreach ($service_id as $key => $val) { $service_info = keke_shop_class::get_service_info($val); $feed_arr = array("feed_username" => array("content" => $service_info['username'], "url" => "index.php?do=seller&id=" . $service_info['uid']), "action" => array("content" => '发布了文件', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$val}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}")); kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $val); PayitemClass::updateTopitem($service_info['service_id'], 'goods'); } } else { $service_info = keke_shop_class::get_service_info($service_id); $feed_arr = array("feed_username" => array("content" => "{$service_info['username']}", "url" => "index.php?do=seller&id={$service_info['uid']}"), "action" => array("content" => '发布作品', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$service_id}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}")); kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $service_id); PayitemClass::updateTopitem($service_id, 'goods'); } } return $res; }
function load() { global $model_list; $type = $this->_charge_type; $response = $this->user_charge(); $model_id = $this->_model_id; if ($type == 'payitem_charge') { PayitemClass::dispose_order($this->_order_id); } else { if ($model_id) { $model_dir = $model_list[$this->_model_id]['model_dir']; $m = $model_dir . "_pay_return_class"; $pay_obj = new $m($type, $this->_model_id, $this->_uid, $this->_obj_id, $this->_order_id, $this->_total_fee); $response = $pay_obj->order_charge(); } } return $response; }
$arrBreadcrumbs = array(1 => array('url' => 'index.php?do=tasklist', 'name' => '任务大厅'), 2 => array('url' => 'index.php?do=tasklist&pd=' . $arrTaskInfo['indus_pid'], 'name' => $indus_p_arr[$arrTaskInfo['indus_pid']]['indus_name']), 3 => array('url' => 'index.php?do=tasklist&pd=' . $arrTaskInfo['indus_pid'] . '&i=' . $arrTaskInfo['indus_id'], 'name' => $indus_arr[$arrTaskInfo['indus_id']]['indus_name'])); $arrWorkFlag = array(1 => array('id' => 2, 'style' => 'fa-trophy', 'name' => '一等奖'), 2 => array('id' => 2, 'style' => 'fa-trophy', 'name' => '二等奖'), 3 => array('id' => 2, 'style' => 'fa-trophy', 'name' => '三等奖'), 4 => array('id' => 4, 'style' => 'fa-check-circle', 'name' => '中标'), 5 => array('id' => 5, 'style' => 'fa-dot-circle-o', 'name' => '入围'), 6 => array('id' => 6, 'style' => 'fa-check-circle', 'name' => '合格'), 7 => array('id' => 7, 'style' => 'fa-times-circle', 'name' => '淘汰'), 8 => array('id' => 8, 'style' => 'fa-times-circle', 'name' => '不可选标'), 9 => array('id' => 9, 'style' => 'fa-times-circle', 'name' => '放弃')); $strUrl = "index.php?do=task&id=" . $intId; $arrView = array('work', 'comment', 'mark'); if (!in_array($view, $arrView)) { $view = 'work'; } $intDeals = TaskClass::getWikiDealbyUid($arrTaskInfo['uid']); $arrWorkService = TaskClass::getWorkServers($intId, $arrTaskInfo['model_id']); $arrUserInfo = keke_user_class::get_user_info($arrTaskInfo['uid']); $strMarkQuerySQl = " SELECT COUNT(mark_id) FROM `" . TABLEPRE . "witkey_mark` "; $strMarkQuerySQl .= " WHERE origin_id = '" . $arrTaskInfo['task_id'] . "' "; $strMarkQuerySQl .= " AND mark_status > 0 AND model_code = '" . $arrModelInfo['model_dir'] . "'"; $arrTaskInfo['mark_num'] = db_factory::get_count($strMarkQuerySQl); $arrPayitemLists = PayitemClass::getPayitemListDetail('task', $arrTaskInfo['task_id']); $arrPayitemListAlls = PayitemClass::getPayitemListForPub('task'); $arrOrderInfo = array(); $sql = "SELECT a.*,b.order_status FROM `" . TABLEPRE . "witkey_order_detail` a LEFT JOIN `" . TABLEPRE . "witkey_order` b ON a.order_id= b.order_id WHERE a.obj_type = 'task' and a.obj_id = " . $arrTaskInfo['task_id']; $arrOrderInfo = db_factory::get_one($sql); if ($arrOrderInfo['order_status'] == 'ok') { $boolIsHosting = true; } else { $boolIsHosting = false; } $arrSimpleTasks = db_factory::query("select * from " . TABLEPRE . "witkey_task where indus_pid=" . $arrTaskInfo['indus_pid'] . " and task_id!=" . $arrTaskInfo['task_id'] . " and task_status not in(0,1,10) order by start_time desc limit 10"); $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by if(b.indus_pid=%d ,1,0) desc, good_rate desc limit 0,5", TABLEPRE, TABLEPRE, $arrTaskInfo['indus_pid']), 1, $intIndexCacheTime); if ($view == 'mark') { $s === null and $s = 100 or $s = intval($s); $arrSearchStatus = array(); $arrSearchStatus['100'] = '所有的'; $arrSearchStatus['1'] = '好评';
public static function task_audit_nopass($task_ids, $trust_response = false) { global $kekezu; global $_lang; if ($task_ids && is_array($task_ids)) { $ids = implode(',', $task_ids); $task_arr = db_factory::query(sprintf("select * from %switkey_task where task_id in(%s)", TABLEPRE, $ids)); foreach ($task_arr as $v) { if ($v['model_id'] == '4' || $v['model_id'] == 5) { $return_cash = $v['real_cash']; } else { $return_cash = $v['task_cash']; } $model_info = $kekezu->_model_list[$v['model_id']]; $class_name = $model_info['model_code'] . "_task_class"; $obj = new $class_name($v); $task_config = $obj->_task_config; $res = db_factory::execute(sprintf("update %switkey_task set task_status=10 where task_id ='%d' ", TABLEPRE, $v['task_id'])); $data = array(':model_name' => $kekezu->_model_list[$v['model_id']]['model_name'], ':task_id' => $v['task_id'], ':task_title' => $v['task_title']); keke_finance_class::init_mem('task_fail', $data); if ($v['task_status'] == 1) { PayitemClass::refundPayitem($v['task_id'], 'task'); keke_finance_class::cash_in($v['uid'], $return_cash, 'task_fail', 'admin', 'task', $v['task_id']); } kekezu::admin_system_log($_lang['audit_task'] . ":{$v['task_title']}" . $_lang['not_pass']); } } elseif ($task_ids) { $ids = $task_ids; $task_info = db_factory::get_one(sprintf("select task_id,task_title,task_status,task_cash,real_cash,model_id,uid,is_trust,trust_type,model_id from %switkey_task where task_id = '%d'", TABLEPRE, $ids)); if ($task_info) { if ($task_info['is_trust'] && $trust_response == false) { $trust_data['refund'] = array($ids, $task_info['task_cash']); $jump_url = keke_trust_fac_class::trust_task_request("pt_refund", $kekezu->_model_list[$task_info['model_id']]['model_dir'], $ids, $task_info['trust_type'], $trust_data); header("Location:" . $jump_url); die; } else { $res = db_factory::execute(sprintf("update %switkey_task set task_status=10 where task_id ='%d' ", TABLEPRE, $ids)); switch ($task_info['is_trust']) { case "1": $fina_cash = $task_info['task_cash']; $data = array("uid" => $task_info['uid'], "username" => $task_info['username'], "obj_id" => $ids, "fina_cash" => $fina_cash, "fina_time" => time(), "fina_action" => "task_fail"); keke_finance_class::finance_trust($data, $task_info['trust_type'], 'in'); break; case "0": if ($task_info['model_id'] == '4' || $task_info['model_id'] == 5) { $return_cash = $task_info['real_cash']; } else { $return_cash = $task_info['task_cash']; } $model_info = $kekezu->_model_list[$task_info['model_id']]; $class_name = $model_info['model_code'] . "_task_class"; $obj = new $class_name($task_info); $task_config = $obj->_task_config; $data = array(':model_name' => $kekezu->_model_list[$v['model_id']]['model_name'], ':task_id' => $task_info['task_id'], ':task_title' => $task_info['task_title']); keke_finance_class::init_mem('task_fail', $data); if ($task_info['task_status'] == 1) { PayitemClass::refundPayitem($task_info['task_id'], 'task'); keke_finance_class::cash_in($task_info['uid'], $return_cash, 'task_fail', 'admin', 'task', $task_info['task_id']); } break; } kekezu::admin_system_log($_lang['audit_task'] . ":{$task_info['task_title']}" . $_lang['not_pass']); } } } return $res; }
<?php kekezu::check_login(); $strPageTitle = '发布任务-' . $_K['html_title']; $strPageKeyword = '发布任务,' . $_K['html_title']; $strPageDescription = $kekezu->_sys_config['index_seo_desc']; $id = intval($id); $step = strval(trim($step)); $strRandKf = kekezu::get_rand_kf(); $is_task_template = db_factory::query("select * from " . TABLEPRE . "witkey_task_template"); $arrPubProcess = array(1 => array('step' => 'step1', 'desc' => '选择交易模式'), 2 => array('step' => 'step2', 'desc' => '描述任务需求'), 3 => array('step' => 'step3', 'desc' => '核对交易清单'), 4 => array('step' => 'step4', 'desc' => '成功发布任务')); $arrPayitemLists = PayitemClass::getPayitemListForPub(); $arrPayitemPriceLists = PayitemClass::getPayitemPriceList(); $arrDistribution = array(1 => '单人中标', 2 => '多人中标', 3 => '', 4 => '单人中标', 5 => '单人中标', 12 => '单人中标'); $arrTopIndustrys = $kekezu->_indus_task_arr; $arrModelLists = kekezu::get_table_data('*', 'witkey_model', " model_type = 'task' and model_status='1'", 'listorder asc ', '', '', 'model_id', 3600); if (0 === $id) { $arrModelIds = array_keys($arrModelLists); $id = $arrModelIds['0']; } $arrModelInfo = $arrModelLists[$id]; if (empty($arrModelInfo)) { kekezu::show_msg('不存在该任务模型,请重新选择', 'index.php?do=pubtask', 3, null, 'warning'); } $arrStep = array('step1', 'step2', 'step3', 'step4'); if (!in_array($step, $arrStep)) { $step = 'step1'; } $strUrl = "index.php?do=pubtask&id=" . $id; $arrOutFinance = db_factory::query(sprintf("select * from %switkey_finance where fina_type='out' and obj_id='%d' and uid='%d'", TABLEPRE, $taskId, $gUid)); if ($arrOutFinance) {
public function checkWhetherToPay($intTaskId) { $floatBalance = floatval($this->_user_info['balance']); $arrConfig = $this->_task_config; $arrTaskInfo = $this->getTaskInfoByTaskId($intTaskId, 'task_id,model_id,task_cash,real_cash'); $intModelId = intval($arrTaskInfo['model_id']); if (in_array($intModelId, array(1, 2, 3, 15))) { $floatTaskCash = floatval($arrTaskInfo['task_cash']); } else { if ($intModelId == 16) { $floatTaskCash = 0; } elseif ($intModelId === 4) { $floatTaskCash = floatval($arrConfig['zb_fees']); } else { if ($intModelId === 5) { $floatTaskCash = $arrTaskInfo['real_cash']; } else { $floatTaskCash = floatval($arrConfig['deposit']); } } } $payitemOrderInfo = PayitemClass::getPayitemOrderAmountByObjId($intTaskId); if (floatval($payitemOrderInfo['order_amount']) > 0) { $floatTotalCash = floatval($payitemOrderInfo['order_amount']); } else { $floatTotalCash = $floatTaskCash; } $arrInfo['total_cash'] = $floatTotalCash; if ($floatBalance >= $floatTotalCash) { $arrInfo['balance_pay'] = true; } else { $arrInfo['balance_pay'] = false; } return $arrInfo; }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); $payitem = PayitemClass::getPayitemConfig($item_code, 0); if ($sbt_edit) { $payitem_obj = keke_table_class::get_instance("witkey_payitem"); $res = $payitem_obj->save($fds, $pk); kekezu::admin_system_log($_lang['edit'] . $payitem['item_name']); kekezu::admin_show_msg($payitem['item_name'] . $_lang['edit_success'], $_SERVER['HTTP_REFERER'], "3", '', 'success'); } else { $model_list = $kekezu->_model_list; } $kekezu->_cache_obj->gc(); require keke_tpl_class::template(ADMIN_DIRECTORY . "/tpl/admin_payitem_edit"); function get_fid($path) { if (!path) { return false; } $querystring = substr(strstr($path, '?'), 1); parse_str($querystring, $query); return $query['fid']; }
$i = intval($i); $pd = intval($pd); $strUrl = "index.php?do=goodslist"; $m and $strUrl .= "&m=" . intval($m); $intPage and $strUrl .= "&intPage=" . intval($intPage); $i and $strUrl .= "&i=" . intval($i); $pd and $strUrl .= "&pd=" . intval($pd); $o and $strUrl .= "&o=" . strval($o); $p and $strUrl .= "&p=" . intval($p); $ky and $strUrl .= "&ky=" . $ky; $arrCashCoves = TaskClass::getTaskCashCove(); $pd and $arrIndusPInfo = kekezu::get_indus_info($pd); $i and $arrIndusInfo = kekezu::get_indus_info($i); $arrCityInfo = CommonClass::getDistrictById($p); $arrDisplaypro = CommonClass::getDistrictByPid('0', 'id,upid,name'); $arrItemConfig = PayitemClass::getPayitemConfig(null, null, null, 'item_id'); $arrIndusP = $kekezu->_indus_goods_arr; $arrIndusC = $kekezu->get_classify_indus('shop', 'child'); if (is_array($arrIndusC)) { $arrNewIndusC = array(); foreach ($arrIndusC as $k => $v) { $arrNewIndusC[$v['indus_pid']][] = $v; } } if (isset($ky)) { $ky = htmlspecialchars($ky); $ky = kekezu::escape($ky); $arrHwStatus = db_factory::query("select v from " . TABLEPRE . "witkey_basic_config where k='hot_words_status'"); $arrUpdateStatus = db_factory::query("select v from " . TABLEPRE . "witkey_basic_config where k='update_status'"); $arrSearch = db_factory::query("select * from " . TABLEPRE . "witkey_hotwords where words = '{$ky}'"); if ($arrHwStatus[0]['v'] == 'open') {
public static function getPayitemShow($arrServiceInfo) { if ($arrServiceInfo['service_status'] != 2 || TOOL == FALSE) { return false; } $arrPayitemListAlls = PayitemClass::getPayitemListForPub('goods'); if (is_array($arrPayitemListAlls)) { $newArray = array(); foreach ($arrPayitemListAlls as $k => $v) { if ($arrServiceInfo[$k] == 1) { $newArray[$k] = $v; } } return $newArray; } return false; }
$action = $_lang['delete']; break; case $_lang['mulit_pass']: foreach ($key_ids as $v) { $service_info = kekezu::get_table_data("*", "witkey_service", "service_id = {$v}"); $service_info = $service_info['0']; $add_time = time() - $service_info['on_time']; keke_payitem_class::update_service_payitem_time($service_info['payitem_time'], $add_time, $v); } $res = goods_shop_class::set_service_status($key_ids, 2); $action = $_lang['mulit_pass']; break; case $_lang['mulit_nopass']: $res = goods_shop_class::set_service_status($key_ids, 4); foreach ($key_ids as $v) { PayitemClass::refundPayitem($v, 'goods'); } $action = '批量审核不通过'; break; case $_lang['batch_shelves']: foreach ($key_ids as $v) { $service_info = kekezu::get_table_data("*", "witkey_service", "service_id = {$v}"); $service_info = $service_info['0']; $add_time = time() - $service_info['on_time']; keke_payitem_class::update_service_payitem_time($service_info['payitem_time'], $add_time, $v); } $res = goods_shop_class::set_service_status($key_ids, 2); $action = $_lang['shelves']; break; case $_lang['batch_off_the_shelf']: $res = goods_shop_class::set_service_status($key_ids, 3);
if ($gUserInfo['autoshop'] != 1) { kekezu::show_msg('店铺已关闭,不能发布!', 'index.php', 3, null, 'warning'); } $strRandKf = kekezu::get_rand_kf(); $arrModelLists = kekezu::get_table_data('*', 'witkey_model', " model_type = 'shop' and model_status='1'", 'listorder', '', '', 'model_id', 3600); if (0 === $id) { $arrIds = array_keys($arrModelLists); $id = $arrIds['0']; } $arrModelInfo = $arrModelLists[$id]; if (empty($arrModelInfo)) { kekezu::show_msg('不存在该任务模型,请重新选择', 'index.php?do=pubtask', 3, null, 'warning'); } $arrTopIndustrys = $kekezu->_indus_goods_arr; $arrPubProcess = array(1 => array('step' => 'step1', 'desc' => '填写服务描述'), 2 => array('step' => 'step2', 'desc' => '核对服务清单'), 3 => array('step' => 'step3', 'desc' => '成功发布服务')); $arrPayitemLists = PayitemClass::getPayitemListForPub('goods'); $arrPayitemPriceLists = PayitemClass::getPayitemPriceList('goods'); $arrStep = array('step1', 'step2', 'step3', 'step4'); if (!in_array($step, $arrStep)) { $step = 'step1'; } $strUrl = "index.php?do=pubgoods&id=" . $id; if ($arrModelInfo['open_custom'] == '1') { $c_open = 1; $arrCustoms = CustomClass::getFieldListsByModelId($arrModelInfo['model_id']); } $arrProvinces = CommonClass::getDistrictByPid('0', 'id,upid,name'); $gUserInfo['province'] and $arrCities = CommonClass::getDistrictByPid($gUserInfo['province'], 'id,upid,name'); $gUserInfo['city'] and $arrAreas = CommonClass::getDistrictByPid($gUserInfo['city'], 'id,upid,name'); $_SESSION['spread'] = 'index.php?do=pubgoods'; require S_ROOT . "/shop/" . $arrModelInfo['model_dir'] . "/control/pub.php";
public function dispose_order($order_id) { global $kekezu, $_K; global $_lang; $task_info = $this->_task_info; $task_status = $this->_task_status; $url = $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id; $order_info = db_factory::get_one(sprintf("select * from %switkey_order where order_id='%d'", TABLEPRE, $order_id)); $order_amount = $order_info['order_amount']; if ($order_info['order_status'] == 'ok') { $task_status == 1 && ($notice = $_lang['task_pay_success_and_wait_admin_audit']); $task_status == 2 && ($notice = $_lang['task_pay_success_and_task_pub_success']); return pay_return_fac_class::struct_response($_lang['operate_notice'], $notice, $url, 'success'); } else { $balance = floatval($this->_g_userinfo['balance']); $order_amount = floatval($order_info['order_amount']); $leave_cash = $balance - $order_amount; if ($leave_cash >= 0) { $order_type = db_factory::get_count(sprintf("select obj_type from %switkey_order_detail where order_id='%d' and obj_type in('hosted','task') ", TABLEPRE, $order_id)); if ($order_type == 'hosted') { $action = 'hosted_margin'; $to_status = 6; $msg = $_lang['order_pay_success_and_task_cash_trust_succss']; } else { $action = 'pub_task'; if ($this->_task_config['open_audit'] == 'close') { $to_status = 2; $msg = $_lang['order_pay_success_and_your_task_success']; } else { $to_status = 1; $msg = $_lang['order_pay_success_and_wait_amin_audit']; } } $arrOrderDetail = keke_order_class::get_order_detail($order_id); foreach ($arrOrderDetail as $k => $v) { if (($v['obj_type'] == 'task' || $v['obj_type'] == 'hosted') && $v['detail_type'] == null) { $data = array($kekezu->_model_list[$task_info['model_id']]['model_name'], $task_info['task_id'], $task_info['task_title']); keke_finance_class::init_mem($action, $data); $res = keke_finance_class::cash_out($this->_guid, $v['price'], $action, 0, 'task', $this->_task_id); } else { PayitemClass::createPayitemRecord($v['detail_type'], $v['num'], $v['obj_type'], $v['obj_id']); } } if ($res) { $objProm = keke_prom_class::get_instance(); if ($objProm->is_meet_requirement("pub_task", $this->_task_id)) { $objProm->create_prom_event("pub_task", $this->_guid, $this->_task_id, $this->_task_info['real_cash']); } keke_order_class::update_fina_order($res, $order_id); if ($action == 'pub_task') { if ($to_status == '2') { $feed_arr = array("feed_username" => array("content" => $task_info['username'], "url" => "index.php?do=seller&id={$task_info['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$task_info['task_title']}", "url" => "index.php?do=task&id={$task_info['task_id']}", "cash" => $task_info['task_cash_coverage'] ? $task_info['task_cash_coverage'] : $task_info['task_cash'], "model_id" => "{$this->_model_id}")); kekezu::save_feed($feed_arr, $task_info['uid'], $task_info['username'], 'pub_task', $task_info['task_id']); $status_arr = self::get_task_status(); $url = '<a href="' . $_K['siteurl'] . '/index.php?do=task&id=' . $task_info['task_id'] . '" target="_blank">' . $task_info['task_title'] . '</a>'; $v = array('model_name' => $this->_model_name, 'task_id' => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_link'] => $url, $_lang['task_status'] => $status_arr[2], '开始时间' => date('Y-m-d H:i:s', $task_info['start_time']), '投稿结束时间' => date('Y-m-d H:i:s', $task_info['sub_time']), '选稿结束时间' => date('Y-m-d H:i:s', $task_info['end_time'])); $this->notify_user("task_pub", '任务发布通知', $v, $notify_type = 1, $task_info['uid']); } db_factory::execute(sprintf(" update %switkey_task set cash_cost='%s' where task_id='%d'", TABLEPRE, $task_info['task_cash'], $this->_task_id)); } $this->set_task_status($to_status); keke_order_class::set_order_status($order_id, 'ok'); return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['order_pay_success'], $url, 'success'); } else { $pay_url = $_K['siteurl'] . "/index.php?do=pay&order_id={$order_id}"; return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_error_and_please_repay'], $url, 'warning'); } } else { $pay_url = $_K['siteurl'] . "/index.php?do=pay&order_id={$order_id}"; return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_error_and_please_repay'], $pay_url, 'warning'); } } }
public function task_top_end() { $arrRecordInfo = PayitemClass::getPayitemRecord('task', $this->_task_id, 'tasktop'); if (time() > $arrRecordInfo['end_time']) { db_factory::execute("update " . TABLEPRE . "witkey_task set tasktop=0 where task_id=" . $this->_task_id); } }
<?php kekezu::admin_check_role(138); $unit = array('times' => $_lang['times'], 'month' => $_lang['month'], 'year' => $_lang['year'], 'day' => $_lang['day']); $payitem_arr = PayitemClass::getPayitemConfig(0, null); $url = "index.php?do={$do}&view={$view}"; $kekezu->_cache_obj->gc(); if ($item_id) { switch ($op) { case 'close': $res = PayitemClass::editPayitem($item_id, array('is_open' => '2')); kekezu::admin_system_log($_lang['close'] . $payitem_name); $res and kekezu::admin_show_msg($_lang['payitem_close_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['payitem_close_fail'], $url, 3, '', 'warning'); case 'open': $res = PayitemClass::editPayitem($item_id, array('is_open' => '1')); kekezu::admin_system_log($_lang['open'] . $payitem_name); $res and kekezu::admin_show_msg($_lang['payitem_open_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['payitem_open_fail'], $url, 3, '', 'warning'); break; } } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_payitem_' . $view);
$arrOrderinfo = db_factory::get_one(sprintf("select order_id from %switkey_order_detail where obj_id=%d and obj_type = 'task'", TABLEPRE, $id)); } $obj = new $className($arrTaskInfo); $arrResult = $obj->dispose_order($arrOrderinfo['order_id']); if (intval($t) == 1) { $jumpUrl = 'index.php?do=task&id=' . $id; db_factory::updatetable(TABLEPRE . 'witkey_task', array('task_status' => 6), array('task_id' => intval($id))); $task_info = db_factory::get_one('select * from ' . TABLEPRE . 'witkey_task where task_id = ' . intval($id)); $work_info = db_factory::get_one('select * from ' . TABLEPRE . 'witkey_task_work where task_id = ' . intval($id) . ' and work_status=4'); $objYj = new yijia_task_class($task_info); $objYj->create_agree_date($work_info); } else { $jumpUrl = 'index.php?do=pubtask&id=' . $arrTaskInfo['model_id'] . '&step=step4&taskId=' . $id . '&status=1'; } kekezu::clearCache(); header('Location:' . $jumpUrl); break; case 'service': if ($orderId) { $arrServcie = db_factory::get_one("select * from " . TABLEPRE . "witkey_service where service_id=" . $id . ""); PayitemClass::payPayitemOrder($orderId); $jumpUrl = 'index.php?do=pubgoods&id=' . $arrServcie['model_id'] . '&step=step3&serviceId=' . $id; header('Location:' . $jumpUrl); } break; case 'order': break; } } } die;
public function checkWhetherToPay($objId, $objType) { $floatBalance = floatval($this->_user_info['balance']); $payitemOrderInfo = PayitemClass::getPayitemOrderAmountByObjId($objId, $objType); if (floatval($payitemOrderInfo['order_amount']) > 0) { $arrInfo['total_cash'] = floatval($payitemOrderInfo['order_amount']); } if ($floatBalance >= $floatTotalCash) { $arrInfo['balance_pay'] = true; } else { $arrInfo['balance_pay'] = false; } return $arrInfo; }
$_POST['file_path_2'] = implode(",", $newArr); $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST); $_POST['province'] = $_POST['onecity']; $_POST['city'] = $_POST['twocity']; $_POST['area'] = $_POST['threecity']; $objRelease->save_service_obj($_POST, $stdCacheName); kekezu::echojson('删除成功', 1, array('fileid' => $fileid, 'save_name' => $arrFileInfo['save_name'])); die; } } break; case 'step2': if (isset($formhash) && kekezu::submitcheck($formhash)) { $arrPayitems = array('goodstop' => intval($txt_goodstop) && intval($text_goodstop) ? intval($text_goodstop) : 0); $arrPayitems = array_filter($arrPayitems); PayitemClass::validPayitemCosts($hdn_total_costs); $arrPubInfo['payitem'] = $arrPayitems; $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST); $objRelease->save_service_obj($_POST, $stdCacheName); $intSid = $objRelease->pub_service(); $objRelease->update_service_info($intSid, $stdCacheName); kekezu::show_msg($tips, $strUrl . '&step=step3&serviceId=' . $intSid, NULL, NULL, 'ok'); } else { !$_SESSION[$stdCacheName] and kekezu::show_msg($_lang['friendly_notice'], "index.php?do=pubgoods&id={$id}", 2, "该商品已提交,不可再返回修改!", "warning"); $objRelease->check_access($step, $id, $arrPubInfo); $strTarComment = kekezu::cutstr(htmlspecialchars_decode($arrPubInfo['tar_content']), 1000); $strCommentLen = strlen($strTarComment); if ($strCommentLen > 500) { $strPartComment = kekezu::cutstr($strTarComment, 500); } }
if (isset($formhash) && kekezu::submitcheck($formhash)) { $sec_code = kekezu::escape(trim($zfpwd)); $strMd5Pwd = keke_user_class::get_password($sec_code, $gUserInfo['rand_code']); $arrUserInfo = db_factory::get_one(sprintf("select * from %switkey_space where uid=%d and sec_code='%s'", TABLEPRE, intval($gUid), $strMd5Pwd)); if (!$arrUserInfo) { $tip['errors']['zfpwd'] = '密码不正确!'; kekezu::show_msg($tip, NULL, NULL, NULL, 'error'); } $arrPayitems = array('urgent' => intval($txt_urgent), 'tasktop' => intval($txt_tasktop) && intval($text_tasktop) ? intval($text_tasktop) : 0, 'workhide' => intval($txt_workhide), 'seohide' => intval($txt_seohide)); if ($arrPayitems['tasktop']) { $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($objId)); $task_day = date('Y-m-d', $arrTaskInfo['sub_time']); $intTopInfo = PayitemClass::getPayitemRecord($type, $objId, 'tasktop'); PayitemClass::validPayitemCount($arrPayitems, $task_day, $intTopInfo['end_time']); } $arrPayitems['goodstop'] = intval($text_goodstop); $arrPayitemBuy = array_filter($arrPayitems); if (is_array($arrPayitemBuy)) { $intOrderId = PayitemClass::creatPayitemOrder($arrPayitemBuy, $type, $objId); if ($intOrderId) { $res = PayitemClass::payPayitemOrder($intOrderId); if ($res === true) { kekezu::show_msg('购买成功', 'index.php?do=' . $type . '&id=' . intval($objId), NULL, NULL, 'ok'); } else { kekezu::show_msg($res, 'index.php?do=pay&type=payitem&id=' . $intOrderId, NULL, NULL, 'fail'); } } } } require keke_tpl_class::template("tpl/default/ajax/payitem"); die;
} else { !$_SESSION[$stdCacheName] and kekezu::show_msg($_lang['friendly_notice'], "index.php?do=pubtask&id={$id}", 2, "任务已提交,不可再返回修改!", "warning"); $objRelease->check_access($step, $id, $arrPubInfo); $strExtTypes = kekezu::get_ext_type(); } $arrFileLists = CommonClass::getFileArray('|', $arrPubInfo['file_ids']); break; case 'step3': $intFileCount = 0; if ($arrPubInfo['file_ids']) { $intFileCount = count(explode('|', $arrPubInfo['file_ids'])); } if (isset($formhash) && kekezu::submitcheck($formhash)) { $arrPayitems = array('urgent' => intval($txt_urgent), 'tasktop' => intval($txt_tasktop) && intval($text_tasktop) ? intval($text_tasktop) : 0, 'workhide' => intval($txt_workhide), 'seohide' => intval($txt_seohide)); $arrPayitems = array_filter($arrPayitems); PayitemClass::validPayitemCount($arrPayitems, $arrPubInfo['txt_task_day']); $_POST['payitem'] = $arrPayitems; $arrPubInfo and $_POST = array_merge($arrPubInfo, $_POST); $objRelease->save_task_obj($_POST, $stdCacheName); $intTaskId = $objRelease->pub_task(); $objRelease->save_task_match($intTaskId); $objRelease->update_task_info($intTaskId, $stdCacheName); kekezu::show_msg($tips, $strUrl . '&step=step4&taskId=' . $intTaskId, NULL, NULL, 'ok'); } else { !$_SESSION[$stdCacheName] and kekezu::show_msg($_lang['friendly_notice'], "index.php?do=pubtask&id={$id}", 2, "任务已提交,不可再返回修改!", "warning"); $objRelease->check_access($step, $id, $arrPubInfo); $strTarComment = htmlspecialchars_decode($arrPubInfo['tar_content']); $strCommentLen = strlen($strTarComment); if ($strCommentLen > 1000) { $strPartComment = kekezu::cutstr($strTarComment, 1000); }
} } $arrBreadcrumbs = array(1 => array('url' => 'index.php?do=goodslist', 'name' => '威客商城'), 2 => array('url' => 'index.php?do=goodslist&pd=' . $arrServiceInfo['indus_pid'], 'name' => $indus_p_arr[$arrServiceInfo['indus_pid']]['indus_name']), 3 => array('url' => 'index.php?do=goodslist&pd=' . $arrServiceInfo['indus_pid'] . '&i=' . $arrServiceInfo['indus_id'], 'name' => $indus_arr[$arrServiceInfo['indus_id']]['indus_name'])); $arrCoverList = keke_shop_class::output_pics($arrServiceInfo['pic'], ''); $intNum = sizeof($arrCoverList); $mc = keke_shop_class::get_mark_count_ext($model_list[$arrServiceInfo['model_id']]['model_code'], $intId); $mc['all'] = intval($mc[1]['c'] + $mc[2]['c']); $mc['seller'] = intval($mc[1]['c']); $mc['buyer'] = intval($mc[2]['c']); $arrOwnerInfo = kekezu::get_user_info($arrServiceInfo['uid']); $strAddress = keke_shop_class::getUserAddress($arrServiceInfo['uid'], 2, 1, 1, 0); $strUserLevel = unserialize($arrOwnerInfo['seller_level']); $arrAuthItems = keke_auth_fac_class::getAuthItemListByUid($arrOwnerInfo['uid']); $arrShopAid = keke_user_mark_class::get_user_aid($arrOwnerInfo['uid'], 2, null, 1); $arrOtherGoods = db_factory::query("select * from " . TABLEPRE . "witkey_service where uid=" . intval($arrOwnerInfo['uid']) . " and service_id!='" . $arrServiceInfo['service_id'] . "' and service_status=2 order by on_time desc limit 3"); $arrPayitemLists = PayitemClass::getPayitemListDetail('goods', $arrServiceInfo['service_id']); $arrPayitemShow = keke_shop_class::getPayitemShow($arrServiceInfo); $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by if(b.indus_pid=%d ,1,0) desc, good_rate desc limit 0,5", TABLEPRE, TABLEPRE, $arrServiceInfo['indus_pid']), 1, $intIndexCacheTime); if ($arrModelInfo['open_custom'] == '1') { $c_open = 1; $arrShowCustoms = CustomClass::getExtData($arrServiceInfo['service_id'], $arrModelInfo['model_id']); foreach ($arrShowCustoms as $k => $v) { if ($v['extdata']) { $arrShowCustoms[$k]['data'] = unserialize($v['extdata']); } } } require S_ROOT . "/shop/" . $arrModelInfo['model_dir'] . "/control/index.php"; require keke_tpl_class::template("shop/" . $arrModelInfo['model_code'] . "/tpl/" . $_K['template'] . "/index"); die; }
public function dispose_order($order_id, $trust_response = false) { global $kekezu, $uid, $username, $_K; global $_lang; $response = array(); $task_config = $this->_task_config; $task_info = $this->_task_info; $url = $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id; $task_status = $this->_task_status; $order_info = db_factory::get_one("select * from " . TABLEPRE . "witkey_order where order_id=" . intval($order_id)); $order_amount = $order_info['order_amount']; if ($order_info['order_status'] == 'ok') { $task_status == 1 && ($notice = $_lang['task_pay_success_and_wait_admin_audit']); $task_status == 2 && ($notice = $_lang['task_pay_success_and_task_pub_success']); return pay_return_fac_class::struct_response($_lang['operate_notice'], $notice, $url, 'success'); } else { $arrOrderDetail = keke_order_class::get_order_detail($order_id); foreach ($arrOrderDetail as $k => $v) { if ($v['obj_type'] == 'task' && $v['detail_type'] == null) { $data = array(':model_name' => $this->_model_name, ':task_id' => $this->_task_id, ':task_title' => $this->_task_title); keke_finance_class::init_mem('pub_task', $data); $res = keke_finance_class::cash_out($task_info['uid'], $v['price'], 'pub_task', 0, 'task', $this->_task_id); } if ($v['obj_type'] == 'task' && $v['detail_type']) { PayitemClass::createPayitemRecord($v['detail_type'], $v['num'], $v['obj_type'], $v['obj_id']); } } switch ($res == true) { case "1": $objProm = keke_prom_class::get_instance(); if ($objProm->is_meet_requirement("pub_task", $this->_task_id)) { $objProm->create_prom_event("pub_task", $this->_guid, $task_info['task_id'], $task_info['task_cash']); } db_factory::updatetable(TABLEPRE . "witkey_order", array("order_status" => "ok"), array("order_id" => "{$order_id}")); keke_order_class::update_fina_order($res, $order_id); $consume = kekezu::get_cash_consume($task_info['task_cash']); db_factory::execute(sprintf(" update %switkey_task set cash_cost='%s',credit_cost='%s' where task_id='%d'", TABLEPRE, $consume['cash'], $consume['credit'], $this->_task_id)); if ($task_info['task_cash'] < $task_config['audit_cash'] && !$this->_trust_mode) { $this->set_task_status(1); return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_success_and_wait_admin_audit'], $url, 'alert_right'); } else { $this->set_task_status(2); $feed_arr = array("feed_username" => array("content" => $task_info['username'], "url" => "index.php?do=seller&id={$task_info['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$task_info['task_title']}", "url" => "index.php?do=task&id={$task_info['task_id']}", "cash" => $task_info['task_cash_coverage'] ? $task_info['task_cash_coverage'] : $task_info['task_cash'], "model_id" => "{$this->_model_id}")); kekezu::save_feed($feed_arr, $task_info['uid'], $task_info['username'], 'pub_task', $task_info['task_id']); $status_arr = self::get_task_status(); $url = '<a href="' . $_K['siteurl'] . '/index.php?do=task&id=' . $task_info['task_id'] . '" target="_blank">' . $task_info['task_title'] . '</a>'; $v = array('model_name' => $this->_model_name, 'task_id' => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_link'] => $url, $_lang['task_status'] => $status_arr[2], '开始时间' => date('Y-m-d H:i:s', $task_info['start_time']), '投稿结束时间' => date('Y-m-d H:i:s', $task_info['sub_time']), '选稿结束时间' => date('Y-m-d H:i:s', $task_info['end_time'])); $this->notify_user("task_pub", '任务发布通知', $v, $notify_type = 1, $task_info['uid']); return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_success_and_task_pub_success'], $url, 'alert_right'); } break; case "0": $pay_url = $_K['siteurl'] . "/index.php?do=pay&order_id={$order_id}"; return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_error_and_please_repay'], $pay_url, 'alert_error'); break; } } }
public static function dispose_order($orderId) { if (TOOL === TRUE) { $arrOrderDetail = keke_order_class::get_order_detail($orderId); $arrOrderInfo = keke_order_class::get_order_info($orderId); $floatCash = floatval($arrOrderInfo['order_amount']); foreach ($arrOrderDetail as $k => $v) { PayitemClass::createPayitemRecord($v['detail_type'], $v['num'], $v['obj_type'], $v['obj_id']); } keke_order_class::set_order_status($orderId, 'ok'); } }