Exemplo n.º 1
0
 public function process_rights($op_result, $type)
 {
     global $kekezu;
     global $_lang;
     $prom_obj = $objProm = keke_prom_class::get_instance();
     $trans_name = $this->get_transrights_name($this->_report_type);
     $op_result = $this->op_result_format($op_result);
     $g_info = $this->user_role('gz');
     $w_info = $this->user_role('wk');
     switch ($op_result['action']) {
         case "pass":
             if ($this->_process_can['sharing']) {
                 $total_cash = floatval($this->_obj_info['cash']);
                 $gz_get = floatval(keke_curren_class::convert($op_result['gz_get'], 0, true));
                 $wk_get = floatval(keke_curren_class::convert($op_result['wk_get'], 0, true));
                 if ($total_cash != $gz_get + $wk_get) {
                     kekezu::admin_show_msg($_lang['wain_you_give_cash_error_notice'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "error");
                 } else {
                     $res = keke_finance_class::cash_in($g_info['uid'], $gz_get, 'rights_return');
                     $res .= keke_finance_class::cash_in($w_info['uid'], $wk_get, 'rights_return');
                     if ($res) {
                         $this->process_unfreeze('pass', $op_result['process_result']);
                         $this->change_status($this->_report_id, '4', $op_result, $op_result['process_result']);
                         $objProm = keke_prom_class::get_instance();
                         $w_event = $objProm->get_prom_event($this->_obj_info['origin_id'], $w_info['uid'], "bid_task");
                         $objProm->set_prom_event_status($w_event['parent_uid'], $this->_gusername, $w_event['event_id'], '3');
                         $g_event = $objProm->get_prom_event($this->_obj_info['origin_id'], $g_info['uid'], "pub_task");
                         $objProm->set_prom_event_status($g_event['parent_uid'], $this->_gusername, $g_event['event_id'], '3');
                     }
                 }
                 $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", "", "success") or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
             } else {
                 kekezu::admin_show_msg($trans_name . $_lang['deal_fail_now_forbit_deal_cash'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
             }
             break;
         case "nopass":
             $this->process_unfreeze('nopass', $op_result['reply']);
             $res = $this->change_status($this->_report_id, '3', $op_result, $op_result['reply']);
             $res1 = $this->reset_agreement($this->_task_obj->_task_id);
             $res && $res1 and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", "", "success") or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
             break;
     }
 }
Exemplo n.º 2
0
 public function dispose_task()
 {
     global $kekezu, $_lang;
     $prom_obj = $objProm = keke_prom_class::get_instance();
     $model_code = $this->_model_code;
     $agree_info = $this->_agree_info;
     $cash_info = db_factory::get_one(sprintf(" select task_cash,task_union,real_cash from %switkey_task where task_id = '%d'", TABLEPRE, $this->_task_id));
     $this->plus_mark_num();
     keke_user_mark_class::create_mark_log($model_code, '1', $agree_info['seller_uid'], $agree_info['buyer_uid'], $agree_info['work_id'], $cash_info['task_cash'], $this->_task_id, $this->_seller_username, $this->_buyer_username);
     keke_user_mark_class::create_mark_log($model_code, '2', $agree_info['buyer_uid'], $agree_info['seller_uid'], $agree_info['work_id'], $cash_info['real_cash'], $this->_task_id, $this->_buyer_username, $this->_seller_username);
     $site_profit = $cash_info['task_cash'] - $cash_info['real_cash'];
     $task_title = db_factory::get_count(sprintf(" select task_title from %switkey_task where task_id='%d'", TABLEPRE, $this->_task_id));
     $data = array(':task_id' => $this->_task_id, ':task_title' => $task_title);
     keke_finance_class::init_mem('task_bid', $data);
     keke_finance_class::cash_in($agree_info['seller_uid'], $cash_info['real_cash'], 'task_bid', '', 'task', $this->_task_id, $site_profit);
     $feed_arr = array("feed_username" => array("content" => $this->_seller_uid, "url" => "index.php?do=seller&id={$this->_seller_uid}"), "action" => array("content" => $_lang['success_bid_haved'], "url" => ""), "event" => array("content" => $task_title, "url" => "index.php?do=task&id={$this->_task_id}", 'cash' => $cash_info['real_cash']));
     kekezu::save_feed($feed_arr, $this->_seller_uid, $this->_seller_username, 'work_accept', $this->_task_id);
     $prom_obj->dispose_prom_event("bid_task", $agree_info['seller_uid'], $this->_task_id);
     $prom_obj->dispose_prom_event("pub_task", $agree_info['buyer_uid'], $this->_task_id);
 }
 public function auth_confirm($auth_info, $user_get_cash)
 {
     global $user_info, $kekezu, $_lang;
     $uid = $user_info['uid'];
     $username = $user_info['username'];
     $intBankAid = $auth_info[$this->_primary_key];
     $pk[$this->_primary_key] = $intBankAid;
     $data['user_get_cash'] = $user_get_cash;
     $this->_tab_obj->save($data, $pk);
     $ac_url = "index.php?do=user&view=account&op=auth&code=" . $this->_auth_code . "&intBankAid=" . $intBankAid . "#userCenter";
     if ($this->set_auth_status($intBankAid, '1')) {
         $this->set_auth_record_status($uid, '1');
         $objProm = keke_prom_class::get_instance();
         $objProm->dispose_prom_event('reg', $uid, $uid);
         $feed_arr = array("feed_username" => array("content" => $username, "url" => "index.php?do=seller&id={$uid}"), "action" => array("content" => $_lang['have_passed'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => ""));
         kekezu::save_feed($feed_arr, $uid, $username, $this->_auth_name);
         $v_arr = array($_lang['auth_code'] => $this->auth_lang(), $_lang['auth_url'] => $ac_url);
         keke_msg_class::notify_user($uid, $username, 'auth_success', $this->auth_lang() . $_lang['success'], $v_arr, 2);
     }
 }
Exemplo n.º 4
0
 public function audit_auth($active_code, $email_a_id)
 {
     global $_K, $kekezu, $_lang;
     $user_info = $kekezu->_userinfo;
     if (md5($user_info['uid'] . $user_info['username'] . $user_info['email']) == $active_code) {
         $arrAuthInfo = $this->get_auth_info($email_a_id);
         if (empty($arrAuthInfo[0])) {
             return false;
         }
         $this->set_auth_status($arrAuthInfo[0][$this->_primary_key], '1');
         $this->set_auth_record_status($arrAuthInfo[0]['uid'], '1');
         $objProm = keke_prom_class::get_instance();
         $objProm->dispose_prom_event('reg', $user_info['uid'], $user_info['uid']);
         $feed_arr = array("feed_username" => array("content" => $user_info[username], "url" => "index.php?do=seller&id={$user_info['uid']}"), "action" => array("content" => $_lang['have_passed'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => ""));
         kekezu::save_feed($feed_arr, $user_info['uid'], $user_info['username'], 'email_auth');
         $v_arr = array($_lang['auth_code'] => $this->auth_lang(), $_lang['auth_url'] => $_K['siteurl'] . '/index.php?do=user&view=account&op=auth&code=email&ver=1#userCenter');
         keke_msg_class::notify_user($user_info['uid'], $user_info['username'], 'auth_success', $this->auth_lang() . $_lang['success'], $v_arr, 2);
         return true;
     }
     return false;
 }
Exemplo n.º 5
0
 public function cancel_bid($obj_id)
 {
     global $kekezu;
     $model_info = $kekezu->_model_list[$this->_obj_info['model_id']];
     if ($model_info['model_code'] == 'dtender' || $model_info['model_code'] == 'tender') {
         db_factory::execute(sprintf("update %switkey_task_bid set bid_status = 8 where bid_id = '%d'", TABLEPRE, $obj_id));
     } else {
         db_factory::execute(sprintf("update %switkey_task_work set work_status = 8 where work_id = '%d'", TABLEPRE, $obj_id));
     }
     db_factory::execute(sprintf(" update %switkey_space set accepted_num = accepted_num-1 where uid = '%d'", TABLEPRE, $this->_obj_info['obj_uid']));
     $objProm = keke_prom_class::get_instance();
     $p_event = $objProm->get_prom_event($this->_task_id, $this->_obj_info['obj_uid'], "bid_task");
     $objProm->set_prom_event_status($p_event['parent_uid'], $this->_gusername, $p_event['event_id'], '3');
     return true;
 }
Exemplo n.º 6
0
$weibo_list = $kekezu->_weibo_list;
$f_c_list = keke_curren_class::get_curr_list('code,title');
$_currencies = keke_curren_class::get_curr_list();
$_footerAbouts = CommonClass::getFooterPage();
$log_account = null;
if (isset($_COOKIE['log_account'])) {
    $log_account = $_COOKIE['log_account'];
}
$wb_type = $_SESSION['wb_type'];
if ($wb_type && $_SESSION['auth_' . $wb_type]['last_key']) {
    $oa = new keke_oauth_login_class($wb_type);
    $oauth_user_info = $oa->get_login_user_info();
}
if (intval($u)) {
    if (!isset($_COOKIE['prom'])) {
        $objProm = keke_prom_class::get_instance();
        $objProm->create_prom_cookie($_SERVER['QUERY_STRING']);
    }
}
$arrTopIndus = db_factory::query("SELECT count(task_id) as count ,indus_id FROM  " . TABLEPRE . "witkey_task where task_status>=2 group by indus_id order by count desc limit 5");
kekezu::redirect_second_domain();
$arrDisplaypro = CommonClass::getDistrictByPid('0', 'id,upid,name');
if ($gUid) {
    //2015-08-02 修改   task_status  由0->8
    $intWaitPay = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_task where uid=" . intval($gUid) . " and task_status=0");
    $intChoose = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_task where uid=" . intval($gUid) . " and task_status=3");
    $intShopPay = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_order a left join " . TABLEPRE . "witkey_order_detail b on a.order_id=b.order_id\n\t\t where a.order_uid=" . intval($gUid) . " and a.order_status='wait' and b.obj_type='service'");
    $intMarkG = db_factory::execute("select * from " . TABLEPRE . "witkey_mark where mark_status=0 and mark_type=2 and by_uid=" . intval($gUid));
    $intMarkW = db_factory::execute("select * from " . TABLEPRE . "witkey_mark where mark_status=0 and mark_type=1 and by_uid=" . intval($gUid));
    $intService = db_factory::get_count("SELECT COUNT(*) as count2 FROM `" . TABLEPRE . "witkey_order` AS a  LEFT JOIN " . TABLEPRE . "witkey_order_detail AS b ON a.order_id = b.order_id  LEFT JOIN " . TABLEPRE . "witkey_service_order AS c ON b.order_id = c.order_id  WHERE  1=1  and a.seller_uid = " . $gUid . " and b.obj_type = 'service' and a.order_status ='seller_confirm' order by b.order_id desc");
    $intGy = db_factory::get_count("SELECT count(*) as count2 FROM `" . TABLEPRE . "witkey_service_order` as a LEFT JOIN " . TABLEPRE . "witkey_order_detail as b ON a.order_id = b.order_id\n\t\t\tLEFT JOIN " . TABLEPRE . "witkey_order as c ON a.order_id = c.order_id\n\t\t\tWHERE 1=1  and c.seller_uid= " . $gUid . " and c.order_status!= 'close' and c.order_status ='seller_confirm' order by c.order_time desc");
Exemplo n.º 7
0
 public function valid_auth($data)
 {
     global $kekezu, $user_info, $_lang;
     $uid = $user_info['uid'];
     $mobile_obj = new Keke_witkey_auth_mobile_class();
     $mobile_obj->setWhere('uid=' . $user_info[uid]);
     $mobile_info = $mobile_obj->query_keke_witkey_auth_mobile();
     $mobile_info = $mobile_info[0];
     $valid_code = $mobile_info[valid_code];
     if ($data['valid_code'] == $valid_code) {
         $end_time = time();
         $this->set_auth_record_status($mobile_info['uid'], 1);
         $mobile_obj->setWhere('uid=' . $user_info[uid]);
         $mobile_obj->setEnd_time($end_time);
         $mobile_obj->setAuth_status(1);
         $res2 = $mobile_obj->edit_keke_witkey_auth_mobile();
         parse_str($_SERVER['HTTP_REFERER'], $arr);
         $url = str_ireplace('step2', 'step3', $_SERVER['HTTP_REFERER']);
         if ($res2) {
             db_factory::execute(" update " . TABLEPRE . "witkey_space set mobile='{$mobile_info['mobile']}' where uid = '{$user_info['uid']}' ");
             $objProm = keke_prom_class::get_instance();
             $objProm->dispose_prom_event('reg', $uid, $uid);
             return TRUE;
         }
         return FALSE;
     }
     return FALSE;
 }
Exemplo n.º 8
0
 public function dispose_order($order_id, $action, $isApp = FALSE)
 {
     global $uid, $username, $_K, $kekezu, $_lang;
     $order_info = keke_order_class::get_order_info($order_id);
     if ($order_info) {
         $s_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=transaction&op=sold&intModelId=" . $order_info['model_id'] . "&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>";
         $b_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=transaction&op=orders&intModelId=" . $order_info['model_id'] . "&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>";
         if ($uid == $order_info['order_uid'] || $uid == $order_info['seller_uid']) {
             $service_info = keke_shop_class::get_service_info($order_info['obj_id']);
             switch ($action) {
                 case "wait":
                     $res = keke_order_class::set_order_status($order_id, $action);
                     if ($res) {
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToBuyer($order_info, '对方已经接受了你的雇佣要求');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => $_lang['recept_your_order'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                             keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_create", $_lang['goods_order_recept'], $v_arr);
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1008, 'orderid' => $order_id));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1009, 'orderid' => $order_id));
                         } else {
                             return $_lang['order_deal_fail_and_link_kf'];
                         }
                     }
                     break;
                 case "ok":
                     if ($order_info['obj_type'] == 'gy') {
                         $data = array(':title' => $order_info['order_name']);
                     } else {
                         $data = array(':service_id' => $order_info['obj_id'], ':title' => $order_info['order_name']);
                         $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => $_lang['recept_your_order'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                         keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_recept'], $v_arr);
                     }
                     keke_finance_class::init_mem('buy_' . $order_info['obj_type'], $data);
                     if ($order_info['order_amount'] > 0) {
                         $suc = keke_finance_class::cash_out($order_info['order_uid'], $order_info['order_amount'], 'buy_' . $order_info['obj_type'], '', 'service', $order_info['obj_id']);
                     } else {
                         $suc = 1;
                     }
                     if ($suc) {
                         db_factory::execute("update " . TABLEPRE . "witkey_finance set order_id={$order_id} where fina_id={$suc}");
                         keke_order_class::set_order_status($order_id, $action);
                         if ($order_info['obj_type'] == 'gy') {
                             $complete_time = time() + 3600 * 24 * 7;
                         } else {
                             if ($service_info['unit_time']) {
                                 $unit_time = $service_info['unit_time'];
                                 switch ($unit_time) {
                                     case '小时':
                                         $complete_time = time() + intval($service_info['service_time']) * 3600;
                                         break;
                                     case '天':
                                         $complete_time = time() + intval($service_info['service_time']) * 3600 * 24;
                                         break;
                                     case '周':
                                         $complete_time = time() + intval($service_info['service_time']) * 3600 * 24 * 7;
                                         break;
                                     case '月':
                                         $complete_time = time() + intval($service_info['service_time']) * 3600 * 24 * 30;
                                         break;
                                 }
                             }
                         }
                         db_factory::execute("update " . TABLEPRE . "witkey_order set service_end_time = {$complete_time} where order_id={$order_info['order_id']}");
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToSeller($order_info, '对方已付款');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => ' 已完成付款', $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                             keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_confirm_pay'], $v_arr);
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1010, 'orderinfo' => $order_info));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1011, 'orderinfo' => $order_info));
                         } else {
                             return '订单付款失败,您的账户余额不足以支付该订单<br />点击这里<a href="index.php?do=pay&id=' . $order_info['order_id'] . '&type=order">去充值</a>';
                         }
                     }
                     break;
                 case "close":
                     $res = keke_order_class::order_cancel_return($order_id);
                     if ($res) {
                         keke_order_class::set_order_status($order_id, $action);
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToSeller($order_info, '对方关闭订单');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['close_order_have'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                             keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_close'], $v_arr);
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1012, 'orderinfo' => $order_info));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1013, 'orderinfo' => $order_info));
                         } else {
                             return $_lang['order_deal_fail_and_link_kf'];
                         }
                     }
                     break;
                 case 'over_time_close':
                     $res = keke_order_class::order_cancel_return($order_id);
                     if ($res) {
                         keke_order_class::set_order_status($order_id, 'close');
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToSeller($order_info, '对方超时未完成服务');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['close_order_have'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                             keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", '超时未完成服务', $v_arr);
                         }
                     }
                     break;
                 case "confirm_complete":
                     $res = keke_order_class::set_order_status($order_id, $action);
                     if ($res) {
                         $objProm = keke_prom_class::get_instance();
                         if ($objProm->is_meet_requirement("service", $order_info[obj_id])) {
                             $objProm->create_prom_event("service", $order_info['order_uid'], $order_info['obj_id'], $order_info['order_amount']);
                         }
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToBuyer($order_info, '对方确认服务工作完成');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => '服务完成', $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                             keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", '服务完成', $v_arr);
                         }
                         if ($order_info['obj_type'] == 'gy') {
                             $arrServiceConfig = unserialize($kekezu->_model_list[7]['config']);
                             $cut_time = time() + intval($arrServiceConfig['confirm_max_day']) * 24 * 3600;
                         } else {
                             $cut_time = time() + $service_info['confirm_max'] * 24 * 3600;
                         }
                         db_factory::execute(sprintf("update %switkey_order set ys_end_time = %d where order_id=%d", TABLEPRE, $cut_time, $order_id));
                         if ($isApp) {
                             app_class::response(array('ret' => 1014, 'orderinfo' => $order_info));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1015, 'orderinfo' => $order_info));
                         } else {
                             return $_lang['order_deal_fail_and_link_kf'];
                         }
                     }
                     break;
                 case "accept":
                     $res = keke_order_class::set_order_status($order_id, $action);
                     if ($res) {
                         $objProm = keke_prom_class::get_instance();
                         if ($objProm->is_meet_requirement("service", $order_info[obj_id])) {
                             $objProm->create_prom_event("service", $order_info['order_uid'], $order_info['obj_id'], $order_info['order_amount']);
                         }
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToBuyer($order_info, '对方确认接收订单');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => $_lang['recept_your_order'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                             keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_recept'], $v_arr);
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1016, 'orderinfo' => $order_info));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1017, 'orderinfo' => $order_info));
                         } else {
                             return $_lang['order_deal_fail_and_link_kf'];
                         }
                     }
                     break;
                 case "working":
                     $intRes = keke_order_class::set_order_status($order_id, $action);
                     if ($order_info['obj_type'] == 'gy') {
                         self::sendNoticeToBuyer($order_info, '对方已经开始工作');
                     }
                     if ($intRes) {
                         return true;
                     } else {
                         return '操作失败';
                     }
                     break;
                 case "send":
                     $res = keke_order_class::set_order_status($order_id, $action);
                     if ($res) {
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToBuyer($order_info, '对方确认服务完成');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => $_lang['confirm_service_complete'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                             keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['service_order_confirm_complete'], $v_arr);
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1018, 'orderinfo' => $order_info));
                         } else {
                             kekezu::keke_show_msg('', $_lang['order_deal_complete_and_order_comfirm'], '', 'json');
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1019, 'orderinfo' => $order_info));
                         } else {
                             kekezu::keke_show_msg('', $_lang['order_deal_fail_and_link_kf'], 'error', 'json');
                         }
                     }
                     break;
                 case "complete":
                     $res = keke_order_class::set_order_status($order_id, $action);
                     if ($res) {
                         $model_info = $kekezu->_model_list[$order_info['model_id']];
                         if ($order_info['obj_type'] == 'gy') {
                             $arrServiceConfig = unserialize($kekezu->_model_list[7]['config']);
                             $profit = floatval($arrServiceConfig['service_profit']) * $order_info['order_amount'] / 100;
                         } else {
                             $profit = $service_info['profit_rate'] * $order_info['order_amount'] / 100;
                         }
                         if ($order_info['obj_type'] == 'gy') {
                             $data = array(':title' => $order_info['order_name']);
                         } else {
                             $data = array(':service_id' => $order_info['obj_id'], ':title' => $order_info['order_name']);
                         }
                         keke_finance_class::init_mem('sale_' . $order_info['obj_type'], $data);
                         keke_finance_class::cash_in($order_info['seller_uid'], $order_info['order_amount'] - $profit, 'sale_' . $order_info['obj_type'], '', 'service', $order_info['obj_id'], $profit);
                         keke_shop_class::plus_sale_num($order_info['obj_id'], $order_info['order_amount']);
                         keke_user_mark_class::create_mark_log($model_info['model_code'], 2, $order_info['order_uid'], $order_info['seller_uid'], $order_id, $order_info['order_amount'] - $profit, $order_info['obj_id'], $order_info['order_username'], $order_info['seller_username']);
                         keke_user_mark_class::create_mark_log($model_info['model_code'], 1, $order_info['seller_uid'], $order_info['order_uid'], $order_id, $order_info['order_amount'], $order_info['obj_id'], $order_info['seller_username'], $order_info['order_username']);
                         keke_shop_class::plus_mark_num($order_info['obj_id']);
                         $objProm = keke_prom_class::get_instance();
                         $objProm->dispose_prom_event("service", $order_info['order_uid'], $order_info['obj_id']);
                         if ($order_info['obj_type'] == 'gy') {
                             self::sendNoticeToSeller($order_info, '对方工作验收完成');
                         } else {
                             $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['confirm_service_complete'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                             keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['service_order_confirm_complete'], $v_arr);
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1020, 'orderinfo' => $order_info));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1021, 'orderinfo' => $order_info));
                         } else {
                             return $_lang['order_deal_fail_and_link_kf'];
                         }
                     }
                     break;
                 case "arbitral":
                     $res = keke_order_class::set_order_status($order_id, $action);
                     if ($res) {
                         if ($order_info['obj_type'] == 'gy') {
                             if ($uid == $order_info['order_uid']) {
                                 self::sendNoticeToSeller($order_info, $_lang['sevice_order_arbitrate_submit']);
                             } else {
                                 self::sendNoticeToBuyer($order_info, $_lang['sevice_order_arbitrate_submit']);
                             }
                         } else {
                             if ($uid == $order_info['order_uid']) {
                                 $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['buyer_start_arbitrate'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                 keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['sevice_order_arbitrate_submit'], $v_arr);
                             } else {
                                 $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => $_lang['seller_start_arbitrate'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                                 keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['sevice_order_arbitrate_submit'], $v_arr);
                             }
                         }
                         if ($isApp) {
                             app_class::response(array('ret' => 1022, 'orderinfo' => $order_info));
                         } else {
                             return true;
                         }
                     } else {
                         if ($isApp) {
                             app_class::response(array('ret' => 1023, 'orderinfo' => $order_info));
                         } else {
                             return $_lang['order_deal_fail_and_link_kf'];
                         }
                     }
                     break;
                 case "delete":
                     $res = keke_order_class::del_order($order_id);
                     if ($isApp) {
                         $res and app_class::response(array('ret' => 1006)) or app_class::response(array('ret' => 1007));
                     } else {
                         $res and kekezu::keke_show_msg('', $_lang['order_delete_success'], "", 'json') or kekezu::keke_show_msg('', $_lang['order_delete_fail'], "error", 'json');
                     }
                     break;
             }
         } else {
             if ($isApp) {
                 app_class::response(array('ret' => 1024, 'orderinfo' => $order_info));
             } else {
                 return $_lang['error_order_num_notice'];
             }
         }
     } else {
         if ($isApp) {
             app_class::response(array('ret' => 1025, 'orderinfo' => $order_info));
         } else {
             return $_lang['no_exist_goods_order'];
         }
     }
 }
Exemplo n.º 9
0
<?php

defined('IN_KEKE') or exit('Access Denied');
$objPromEventT = keke_table_class::get_instance('witkey_prom_event');
$strUrl = 'index.php?do=user&view=prom&op=benefit';
$intEventId and $strUrl .= "&intEventId=" . intval($intEventId);
$strEventType and $strUrl .= "&strEventType= {$strEventType} ";
$intPage and $strUrl .= '&intPage=' . $intPage;
$arrEventStatus = keke_prom_class::get_pevent_status();
$arrEventType = keke_prom_class::get_prom_type();
$strWhere = " parent_uid=" . intval($gUid);
$intEventId && $intEventId != '' and $strWhere .= " and event_id=" . intval($intEventId);
$strEventType and $strWhere .= " and action = '{$strEventType}' ";
$page and $intPage = intval($page);
$intPage = intval($intPage) ? $intPage : 1;
$intPagesize = intval($intPagesize) ? $intPagesize : 10;
$strWhere .= " order by event_id desc";
$arrDatas = $objPromEventT->get_grid($strWhere, $strUrl, $intPage, $intPagesize, null, null, null);
$arrPromLists = $arrDatas['data'];
$strPages = $arrDatas['pages'];
Exemplo n.º 10
0
 public function save_user_info($user_info, $account, $ckb_cookie = 1, $login_type = 0, $auto_login = 0, $oauth_login = 0)
 {
     global $kekezu, $_K, $handlekey;
     global $_lang;
     $_SESSION['uid'] = $user_info['uid'];
     $_SESSION['username'] = $user_info['username'];
     $_SESSION['last_login_time'] = $user_info['last_login_time'];
     $this->add_login_time(0);
     $login_type = $this->_login_type;
     if ($auto_login == '1') {
         $c = array();
         $c[0] = base64_encode($user_info['uid']);
         $c[1] = base64_encode($account);
         $c[2] = base64_encode($user_info['uid'] . '|' . $user_info['password'] . '|' . $account);
         setcookie('keke_auto_login', serialize($c), time() + 3600 * 24 * 30);
     }
     if ($_K['refer']) {
         //登录之后不同身份跳转到各自管理页面
         $user_obj = new keke_user_class();
         $user_type = $user_obj->get_user_type($user_info['uid']);
         if ($user_type['user_type'] == 2) {
             $r_url = '?do=user&view=wk';
         } elseif ($user_type['user_type'] == 1) {
             $r_url = '?do=user&view=gz';
         }
         $r = $_K['refer'] . $r_url;
     } else {
         $r = 'index.php';
     }
     if ($login_type) {
         $r = 'index.php';
     }
     if ($oauth_login) {
         $r = 'index.php';
     }
     if ($this->_sys_config['user_intergration'] == 2) {
         $synhtml = keke_user_class::user_synlogin($user_info['uid'], $this->_password);
     }
     $synhtml = isset($synhtml) ? $synhtml : "";
     $user_obj = new Keke_witkey_space_class();
     $user_obj->setLast_login_time(time());
     $user_obj->setWhere("uid = '{$user_info['uid']}'");
     $user_obj->edit_keke_witkey_space();
     $black_obj = new Keke_witkey_member_black_class();
     $black_obj->setWhere("uid = '{$user_info['uid']}'");
     $black_obj->del_keke_witkey_member_black();
     db_factory::execute(sprintf("update %switkey_member_oltime set last_op_time=%d where uid = %d", TABLEPRE, time(), $user_info['uid']));
     if (isset($_COOKIE['prom']) && $_COOKIE['prom']) {
         $prom_obj = keke_prom_class::get_instance();
         $url_data = $prom_obj->extract_prom_cookie();
         $url_data['p'] == 'reg' or $prom_obj->create_prom_relation($user_info['uid'], $user_info['username'], $url_data, '2');
     }
     if ($login_type == 1) {
         if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
             $this->show_msg($_lang['login_success'] . "{$synhtml}", 1, $r);
         } elseif (strtolower($_SERVER['REQUEST_METHOD']) == 'get') {
             echo "{$synhtml}<script>window.location.href='{$r}';</script>";
             die;
         }
     } else {
         if ($login_type == 3 || $login_type == 4) {
             $info = $user_info;
             $return_info['uid'] = $info['uid'];
             $return_info['username'] = $info['username'];
             $return_info['balance'] = intval($info['balance']);
             $return_info['credit'] = intval($info['credit']);
             $return_info['pic'] = keke_user_class::get_user_pic($user_info['uid']);
             $return_info['syn'] = $synhtml;
             $user_info['uid'] == ADMIN_UID || $user_info['group_id'] > 0 and $return_info['is_admin'] = 1;
             $return_info['g_pic'] = unserialize($info['buyer_level']);
             $return_info['s_pic'] = unserialize($info['seller_level']);
             $this->show_msg($_lang['login_success'], 1, $return_info);
             die;
         } elseif ($login_type == 2) {
             return true;
         } else {
             $this->show_msg($_lang['login_success'] . "{$synhtml}", 1, $r);
         }
     }
 }
Exemplo n.º 11
0
 public function dispose_order($order_id, $action, $is_kf = null, $ht_url = null, $kefu_uid = NULL, $isApp = false)
 {
     global $_lang, $uid, $username, $_K, $kekezu;
     if ($is_kf && $is_kf != 'sys' && $kefu_uid) {
         $u_info = kekezu::get_user_info($kefu_uid);
         if ($u_info['group_id'] == 7) {
             $kefu = TRUE;
         } else {
             $kefu = false;
         }
     } else {
         $kefu = false;
     }
     if ($is_kf == 'sys') {
         $kefu = TRUE;
     }
     $order_info = keke_order_class::get_order_info($order_id);
     $service_info = keke_shop_class::get_service_info($order_info['obj_id']);
     if ($order_info) {
         $s_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=transaction&op=sold&intModelId=" . $service_info['model_id'] . "\">" . $order_info['order_name'] . "</a>";
         $b_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=transaction&op=orders&intModelId=" . $service_info['model_id'] . "\">" . $order_info['order_name'] . "</a>";
         if ($uid == $order_info['order_uid'] || $uid == $order_info['seller_uid'] || $uid == ADMIN_UID || $kefu) {
             if ($service_info['service_status'] == '2') {
                 if ($action == 'delete') {
                     $res = keke_order_class::del_order($order_id, '', 'json');
                     if ($isApp) {
                         $res and app_class::response(array('ret' => 1006)) or app_class::response(array('ret' => 1007));
                     }
                 } else {
                     switch ($action) {
                         case "ok":
                             $data = array(':service_id' => $service_info['service_id'], ':title' => $service_info['title']);
                             keke_finance_class::init_mem('buy_service', $data);
                             if ($order_info['order_amount'] > 0) {
                                 $suc = keke_finance_class::cash_out($order_info['order_uid'], $order_info['order_amount'], 'buy_service', '', 'service', $order_info['obj_id']);
                             } else {
                                 $suc = 1;
                             }
                             if ($suc) {
                                 db_factory::execute("update " . TABLEPRE . "witkey_finance set order_id={$order_id} where fina_id={$suc}");
                                 keke_order_class::set_order_status($order_id, $action);
                                 $exec_time = time() + $service_info['confirm_max'] * 24 * 3600;
                                 db_factory::execute(sprintf(" update %switkey_order set ys_end_time='%d' where order_id='%d'", TABLEPRE, $exec_time, $order_id));
                                 $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['haved_confirm_pay'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                 keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_confirm_pay'], $v_arr);
                                 $objProm = keke_prom_class::get_instance();
                                 if ($objProm->is_meet_requirement("service", $order_info['obj_id'])) {
                                     $objProm->create_prom_event("service", $order_info['order_uid'], $order_info['obj_id'], $order_info['order_amount']);
                                 }
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1010, 'orderinfo' => $order_info));
                                 } else {
                                     return true;
                                 }
                             } else {
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1011, 'orderinfo' => $order_info));
                                 } else {
                                     return '订单付款失败,您的账户余额不足以支付该订单<br />点击这里<a href="index.php?do=pay&id=' . $order_info['order_id'] . '&type=order">去充值</a>';
                                 }
                             }
                             break;
                         case "close":
                             $res = keke_order_class::order_cancel_return($order_id);
                             if ($res) {
                                 keke_order_class::set_order_status($order_id, $action);
                                 $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['close_order_have'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                 keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_close'], $v_arr);
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1012, 'orderinfo' => $order_info));
                                 } else {
                                     kekezu::show_msg($_lang['system prompt'], "index.php?do=user&view=employer&op=shop&model_id=" . $service_info['model_id'], '1', $_lang['order_deal_complete_and_close'], 'alert_right');
                                 }
                             } else {
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1013, 'orderinfo' => $order_info));
                                 } else {
                                     kekezu::show_msg($_lang['system prompt'], "index.php?do=user&view=employer&op=shop&model_id=" . $service_info['model_id'], '1', $_lang['order_deal_fail_and_link_kf'], 'alert_error');
                                 }
                             }
                             break;
                         case "confirm":
                             $res = keke_order_class::set_order_status($order_id, $action);
                             if ($res) {
                                 $model_info = $kekezu->_model_list[$order_info['model_id']];
                                 $profit = $service_info['profit_rate'] * $order_info['order_amount'] / 100;
                                 $data = array(':service_id' => $service_info['service_id'], ':title' => $service_info['title']);
                                 keke_finance_class::init_mem('sale_service', $data);
                                 keke_finance_class::cash_in($order_info['seller_uid'], $order_info['order_amount'] - $profit, 'sale_service', '', 'service', $order_info['obj_id'], $profit);
                                 keke_shop_class::plus_sale_num($order_info['obj_id'], $order_info['order_amount']);
                                 keke_user_mark_class::create_mark_log($model_info['model_code'], 2, $order_info['order_uid'], $order_info['seller_uid'], $order_id, $order_info['order_amount'] - $profit, $order_info['obj_id'], $order_info['order_username'], $order_info['seller_username']);
                                 keke_user_mark_class::create_mark_log($model_info['model_code'], 1, $order_info['seller_uid'], $order_info['order_uid'], $order_id, $order_info['order_amount'], $order_info['obj_id'], $order_info['seller_username'], $order_info['order_username']);
                                 keke_shop_class::plus_mark_num($order_info['obj_id']);
                                 $objProm = keke_prom_class::get_instance();
                                 if ($objProm->is_meet_requirement("service", $order_info[obj_id])) {
                                     $objProm->create_prom_event("service", $order_info['order_uid'], $order_info['obj_id'], $order_info['order_amount']);
                                 }
                                 $objProm->dispose_prom_event("service", $order_info['order_uid'], $order_info['obj_id']);
                                 if ($is_kf != null) {
                                     $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => '客服协助作品已交付完成', $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                     keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['work_order_complete'], $v_arr);
                                     $v_arr1 = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => '客服协助作品已交付完成', $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                     keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['work_order_complete'], $v_arr1);
                                     return true;
                                 } else {
                                     $v_arr = array($_lang['user_msg'] => $order_info['order_username'], $_lang['action'] => $_lang['buy_work_coplete'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                     keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['work_order_complete'], $v_arr);
                                     if ($isApp) {
                                         app_class::response(array('ret' => 1022, 'orderinfo' => $order_info));
                                     } else {
                                         return true;
                                     }
                                 }
                             } else {
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1023, 'orderinfo' => $order_info));
                                 } else {
                                     kekezu::show_msg($_lang['system prompt'], "index.php?do=order&sid={$order_info['obj_id']}&orderId={$order_id}&steps=step3", '1', $_lang['order_deal_fail_and_link_kf'], 'alert_error');
                                 }
                             }
                             break;
                         case "arbitral":
                             $res = keke_order_class::set_order_status($order_id, $action);
                             if ($res) {
                                 if ($uid == $order_info['order_uid']) {
                                     $v_arr = array($_lang['user'] => $order_info['order_username'], $_lang['action'] => $_lang['buyer_start_arbitrate'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                                     keke_shop_class::notify_user($order_id['seller_uid'], $order_info['seller_username'], "order_change", $_lang['sevice_order_arbitrate_submit'], $v_arr);
                                 } else {
                                     $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], $_lang['action'] => $_lang['seller_start_arbitrate'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                                     keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['work_order_submit'], $v_arr);
                                 }
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1022, 'orderinfo' => $order_info));
                                 } else {
                                     return true;
                                 }
                             } else {
                                 if ($isApp) {
                                     app_class::response(array('ret' => 1023, 'orderinfo' => $order_info));
                                 } else {
                                     return $_lang['order_deal_fail_and_link_kf'];
                                 }
                             }
                             break;
                     }
                 }
             } else {
                 $res = keke_order_class::set_order_status($order_id, 'close');
                 keke_order_class::order_cancel_return($order_id);
                 $v_arr = array($_lang['user_msg'] => $_lang['system'], $_lang['action'] => $_lang['stop_your_order_and_your_cash_return'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $b_order_link);
                 keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_close'], $v_arr);
                 $v_arr = array($_lang['user_msg'] => $_lang['system'], $_lang['action'] => $_lang['stop_your_order_and_your_cash_return'], $_lang['order_id'] => $order_id, $_lang['order_link'] => $s_order_link);
                 keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_close'], $v_arr);
                 if ($isApp) {
                     $res and app_class::response(array('ret' => 1006)) or app_class::response(array('ret' => 1007));
                 } else {
                     $res and kekezu::keke_show_msg('', $_lang['order_delete_success'], "", 'json') or kekezu::keke_show_msg('', $_lang['order_delete_fail'], "error", 'json');
                 }
             }
         } else {
             if ($isApp) {
                 app_class::response(array('ret' => 1024, 'orderinfo' => $order_info));
             } else {
                 kekezu::keke_show_msg('', $_lang['error_order_num_notice'], 'error', 'json');
             }
         }
     } else {
         if ($isApp) {
             app_class::response(array('ret' => 1025, 'orderinfo' => $order_info));
         } else {
             kekezu::keke_show_msg('', $_lang['no_exist_goods_order'], 'error', 'json');
         }
     }
 }
Exemplo n.º 12
0
                $prom_event_obj->setWhere("event_id = " . intval($event_id));
                $res = $prom_event_obj->del_keke_witkey_prom_event();
                $res and kekezu::admin_show_msg($_lang['delete_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['delete_fail'], $url, 3, '', 'warning');
                break;
        }
    }
} elseif (isset($sbt_action)) {
    $ckb_string = $ckb;
    is_array($ckb_string) and $ckb_string = implode(',', $ckb_string);
    if (count($ckb_string)) {
        $prom_event_obj->setWhere('event_id in (' . $ckb_string . ')');
        $res = $prom_event_obj->del_keke_witkey_prom_event();
        $res and kekezu::admin_show_msg($_lang['mulit_operate_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['mulit_operate_fail'], $url, 3, '', 'warning');
    }
} else {
    $type_arr = keke_prom_class::get_prom_type();
    $where = '1=1';
    $w['event_id'] and $where .= " and event_id = " . intval($w['event_id']);
    $w['username'] and $where .= " and username like '%" . $w['username'] . "%'";
    $w['parent_username'] and $where .= " and parent_username like '%" . $w['parent_username'] . "%'";
    $w['action'] and $where .= " and action = '" . $w['action'] . "'";
    $w[ord][0] && $w[ord][1] and $where .= " order by {$w['ord']['0']} {$w['ord']['1']} " or $where .= " order by event_id desc ";
    $prom_event_obj->setWhere($where);
    $count = $prom_event_obj->count_keke_witkey_prom_event();
    $kekezu->_page_obj->setAjax(1);
    $kekezu->_page_obj->setAjaxDom('ajax_dom');
    $pages = $kekezu->_page_obj->getPages($count, $page_size, $page, $url);
    $prom_event_obj->setWhere($where . $pages['where']);
    $prom_event_arr = $prom_event_obj->query_keke_witkey_prom_event();
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
Exemplo n.º 13
0
 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');
         }
     }
 }
Exemplo n.º 14
0
<?php

defined('IN_KEKE') or exit('Access Denied');
$strUrl = 'index.php?do=user&view=prom&op=code';
$strLinkReg = $_K[siteurl] . "/index.php?do=index&u=" . $gUid;
$arrModeReg = keke_prom_class::get_prom_rule('reg');
$arrModePubTask = keke_prom_class::get_prom_rule('pub_task');
$arrModeBidTask = keke_prom_class::get_prom_rule('bid_task');
$arrModeService = keke_prom_class::get_prom_rule('service');
Exemplo n.º 15
0
 function register_login($userinfo, $is_oauth = null)
 {
     global $kekezu;
     global $_lang;
     global $_K;
     $_SESSION['uid'] = $userinfo['uid'];
     $_SESSION['username'] = $userinfo['username'];
     $c = $_COOKIE;
     if ($_K['refer']) {
         $r = $_K['refer'];
     } else {
         $r = 'index.php';
     }
     if (isset($_COOKIE['prom'])) {
         $prom_obj = keke_prom_class::get_instance();
         $url_data = $prom_obj->extract_prom_cookie();
         $prom_obj->create_prom_relation($userinfo['uid'], $userinfo['username'], $url_data);
         $url_data['p'] == 'reg' and $obj_id = $userinfo['uid'] or $obj_id = $url_data['o'];
         $prom_obj->create_prom_event($url_data['p'], $userinfo['uid'], $obj_id);
     }
     $synhtml = keke_user_class::user_synlogin($userinfo['uid'], md5($this->_reg_pwd));
     if ($userinfo['status'] == 3 && $this->_reg_type == 1) {
         if ($userinfo['email'] && !$is_oauth) {
             $arr = explode("@", $userinfo['email']);
             $mail_url = keke_user_class::getAllEmail('@' . $arr[1]);
         }
         if (!$userinfo['email'] || $is_oauth) {
             $this->show_msg("注册成功!", 1, "index.php?do=login");
         } else {
             $_SESSION['uid'] = '';
             $_SESSION['username'] = '';
             $this->show_msg($_lang['register_success_and_excite'] . "{$synhtml}", 1, $mail_url);
         }
     } else {
         if ($this->_reg_type == 2) {
             $userinfo[pic] = keke_user_class::get_user_pic($userinfo['uid']);
             $r = $userinfo;
             db_factory::execute(sprintf(" update %switkey_space set status=1 where uid='%d'", TABLEPRE, $userinfo['uid']));
         }
         $this->show_msg($_lang['register_success'] . "{$synhtml}", 1, 'index.php?do=user&view=account&op=basic');
     }
 }
Exemplo n.º 16
0
 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;
     }
 }
Exemplo n.º 17
0
 function process_rights($op_result, $type)
 {
     global $kekezu, $_K, $_lang;
     $prom_obj = $objProm = keke_prom_class::get_instance();
     $trans_name = $this->get_transrights_name($this->_report_type);
     $op_result = $this->op_result_format($op_result);
     $g_info = $this->user_role('gz');
     $w_info = $this->user_role('wk');
     $match_task = $this->_match_task;
     $match_work = $this->_match_work;
     switch ($op_result['action']) {
         case "pass":
             if ($this->_process_can['sharing']) {
                 $hire = $op_result['hire_deposit'];
                 $wiki = $op_result['wiki_deposit'];
                 $host = $op_result['host_amount'];
                 switch ($hire) {
                     case 1:
                         $g_noti = $_lang['deposit_cash_all_refund'];
                         $res = keke_finance_class::cash_in($g_info['uid'], $match_task['deposit_cash'], 'deposit_return', '', 'task', $match_task['task_id']);
                         break;
                     case 2:
                         $g_noti = $_lang['deposit_cash_part_defund'];
                         $rate = $match_task['deposit_rate'];
                         $cash = floatval($match_task['deposit_cash'] - $rate);
                         $profit = $rate;
                         $res = keke_finance_class::cash_in($g_info['uid'], $cash, 'deposit_return', '', 'task', $match_task['task_id'], $profit);
                         break;
                     case 3:
                         $g_noti = $_lang['deposit_cash_all_deduct'];
                         $res = db_factory::execute(sprintf(" update %switkey_finance set site_profit='%.2f' where obj_id='%d' and fina_type='out' and fina_action='pub_task'", TABLEPRE, $match_task['hirer_deposit'], $match_task['task_id']));
                         break;
                 }
                 switch ($wiki) {
                     case 1:
                         $w_noti = $_lang['deposit_cash_all_refund'];
                         $res = keke_finance_class::cash_in($w_info['uid'], $match_work['deposit_cash'], 'deposit_return', '', 'task', $match_task['task_id']);
                         break;
                     case 2:
                         $w_noti = $_lang['deposit_cash_part_defund'];
                         $rate = $match_task['deposit_rate'];
                         $cash = floatval($match_work['deposit_cash'] - $rate);
                         $profit = $rate;
                         $res = keke_finance_class::cash_in($w_info['uid'], $cash, 'deposit_return', '', 'task', $match_task['task_id'], $profit);
                         break;
                     case 3:
                         $w_noti = $_lang['deposit_cash_all_deduct'];
                         $res = db_factory::execute(sprintf(" update %switkey_finance set site_profit='%.2f' where obj_id='%d' and fina_type='out' and fina_action='host_deposit'", TABLEPRE, $match_task['hirer_deposit'], $match_work['work_id']));
                         break;
                 }
                 switch ($host) {
                     case 1:
                         $g_noti .= $_lang['host_cash_has_all_been_refund'];
                         $data = array(':task_id' => $match_task['task_id'], ':task_title' => $match_task['task_title']);
                         keke_finance_class::init_mem('host_return', $data);
                         $res .= keke_finance_class::cash_in($g_info['uid'], $match_task['host_cash'], 'host_return', '', 'task', $match_task['task_id']);
                         break;
                     case 2:
                         $hire_get = floatval(keke_curren_class::convert($op_result['hire_get'], 0, true));
                         $wiki_get = floatval(keke_curren_class::convert($op_result['wiki_get'], 0, true));
                         $g_noti .= $_lang['host_cash_has_part_been_refund'];
                         $data = array(':task_id' => $match_task['task_id'], ':task_title' => $match_task['task_title']);
                         keke_finance_class::init_mem('host_split', $data);
                         $res .= keke_finance_class::cash_in($g_info['uid'], $hire_get, 'host_split', '', 'task', $match_task['task_id']);
                         $w_noti .= $_lang['get_part_host_cash'];
                         $rate = db_factory::get_count(sprintf(" select profit_rate from %switkey_task where task_id ='%d'", TABLEPRE, $match_task['task_id']));
                         $profit = $wiki_get * $rate / 100;
                         $wiki_get -= $profit;
                         $data = array(':task_id' => $match_task['task_id'], ':task_title' => $match_task['task_title']);
                         keke_finance_class::init_mem('host_split', $data);
                         $res .= keke_finance_class::cash_in($w_info['uid'], $wiki_get, 'host_split', '', 'task', $match_task['task_id'], $profit);
                         break;
                 }
                 if ($res) {
                     $this->change_status($this->_report_id, '4', $op_result, $op_result['process_result']);
                     $w_event = $objProm->get_prom_event($this->_obj_info['origin_id'], $w_info['uid'], "bid_task");
                     $objProm->set_prom_event_status($w_event['parent_uid'], $this->_gusername, $w_event['event_id'], '3');
                     $g_event = $objProm->get_prom_event($this->_obj_info['origin_id'], $g_info['uid'], "pub_task");
                     $objProm->set_prom_event_status($g_event['parent_uid'], $this->_gusername, $g_event['event_id'], '3');
                     $url = "<a href=\"{$_K['siteurl']}/index.php?do=task&id={$match_task['task_id']}\">{$this->_obj_info['origin_title']}</a>";
                     $msg_obj = new keke_msg_class();
                     $g_notify = array($_lang['description'] => $_lang['match_task_trans_result'] . $g_noti, $_lang['task_title'] => $url);
                     $msg_obj->send_message($g_info['uid'], $g_info['username'], 'match_task', $_lang['match_website_deal_notice'], $g_notify, $g_info['email']);
                     $w_notify = array($_lang['description'] => $_lang['match_task_trans_result'] . $w_noti, $_lang['task_title'] => $url);
                     $msg_obj->send_message($w_info['uid'], $w_info['username'], 'match_task', $_lang['match_website_deal_notice'], $w_notify, $w_info['email']);
                     db_factory::execute(sprintf(" update %switkey_task set task_status=9 where task_id='%d'", TABLEPRE, $match_task['task_id']));
                 }
                 $res and kekezu::admin_show_msg($trans_name . $_lang['deal_success'], "index.php?do=trans&view=rights&type={$type}", "3", "", "success") or kekezu::admin_show_msg($trans_name . $_lang['deal_fail'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
             } else {
                 kekezu::admin_show_msg($trans_name . $_lang['deal_fail_now_forbit_deal_cash'], "index.php?do=trans&view=process&type={$type}&report_id=" . $this->_report_id, "3", "", "warning");
             }
             break;
         case "nopass":
             break;
     }
 }
Exemplo n.º 18
0
 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;
         }
     }
 }
Exemplo n.º 19
0
 public function create_prom_event($task_id)
 {
     global $kekezu;
     $task_obj = $this->_task_obj;
     if ($this->_model_info['model_code'] != 'tender') {
         $this->_model_info['model_code'] == 'dtender' and $task_cash = $task_obj->getReal_cash() or $task_cash = $task_obj->getTask_cash();
         $prom_obj = keke_prom_class::get_instance();
         if ($prom_obj->is_meet_requirement("pub_task", $task_id)) {
             $prom_obj->create_prom_event("pub_task", $this->_uid, $task_id, $task_cash);
         }
     }
 }