function task_finish_auto_mark() { $nomark_wk_list = db_factory::query(sprintf('select `mark_id` from %switkey_mark where model_code="%s" and mark_status=0 and mark_max_time<%d and mark_type=1', TABLEPRE, 'dtender', time())); if (is_array($nomark_wk_list)) { foreach ($nomark_wk_list as $v) { keke_user_mark_class::exec_mark_process($v['mark_id'], "系统自动好评", 1, "4,5", "5.0,5.0"); } } $nomark_gz_list = db_factory::query(sprintf('select `mark_id` from %switkey_mark where model_code="%s" and mark_status=0 and mark_max_time<%d and mark_type=2', TABLEPRE, 'dtender', time())); if (is_array($nomark_gz_list)) { foreach ($nomark_gz_list as $v) { keke_user_mark_class::exec_mark_process($v['mark_id'], "系统自动好评", 1, "1,2,3", "5.0,5.0,5.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); }
function save_userinfo($reg_username, $reg_email, $reg_uid = null, $user_type, $reg_user_type_xf) { global $_K; $reg_username = kekezu::escape($reg_username); $slt = kekezu::randomkeys(6); $pwd = keke_user_class::get_password($this->_reg_pwd, $slt); $this->_member_obj->setUid($reg_uid); $this->_member_obj->setEmail($reg_email); $this->_member_obj->setUsername($reg_username); $this->_member_obj->setPassword($this->_reg_pwd); $this->_member_obj->setRand_code($slt); $this->_member_obj->setUser_type($user_type); //增加user_type $reg_member_uid = $this->_member_obj->create_keke_witkey_member(); $this->_oltime_obj->setUid($reg_member_uid); $this->_oltime_obj->setUsername($reg_username); $this->_oltime_obj->setLast_op_time(time()); $this->_oltime_obj->setOnline_total_time(0); $this->_oltime_obj->create_keke_witkey_member_oltime(); if ($reg_member_uid) { $buyer_level = keke_user_mark_class::get_mark_level(0, '2'); $seller_level = keke_user_mark_class::get_mark_level('0', '1'); $this->_shop_obj->setShop_type(1); $this->_shop_obj->setUid($reg_member_uid); $this->_shop_obj->setUsername($reg_username); $this->_shop_obj->setShop_name($reg_username); $this->_shop_obj->setShop_status($_K['autoshop'] == '1' ? '1' : '3'); $res_shop_id = $this->_shop_obj->create_keke_witkey_shop(); $this->_space_obj->setUid($reg_member_uid); $this->_space_obj->setUsername($reg_username); $this->_space_obj->setPassword($this->_reg_pwd); $this->_space_obj->setSec_code($pwd); $this->_space_obj->setEmail($reg_email); $this->_space_obj->setReg_time(time()); $this->_space_obj->setReg_ip(keke_glob_class::checkipaddres($this->_reg_ip) ? $this->_reg_ip : '0.0.0.0'); $this->_space_obj->setBuyer_level(serialize($buyer_level)); $this->_space_obj->setSeller_level(serialize($seller_level)); $this->_space_obj->setAutoshop($_K['autoshop']); $this->_space_obj->setUser_type($reg_user_type_xf); //修改用户实名认证类型 $space_id = $this->_space_obj->create_keke_witkey_space(); } $info = array('uid' => $reg_member_uid, 'username' => $reg_username, 'email' => $reg_email); $this->_sys_config['allow_reg_action'] == 1 and keke_user_class::send_email_action_user($info); return $reg_member_uid; }
$arrBuyerInfo = kekezu::get_user_info($arrOrderInfo['order_uid']); $arrOrderInfo['seller_uid'] != $id and kekezu::show_msg('用户订单不存在', 'index.php?do=seller&id=' . $id, 3, '订单已关闭', 'warning'); $arrBuyerInfo['comefrom'] = keke_shop_class::getUserAddress($arrOrderInfo['order_uid'], 2, 1, 1, 0); $arrBuyerInfo['userlevel'] = unserialize($arrBuyerInfo['buyer_level']); $arrAid = keke_user_mark_class::get_user_aid($arrBuyerInfo['uid'], 1, null, '1'); $arrServiceOrderInfo['indus_pid'] and $arrAllIndustrys = CommonClass::getIndustryByPid($arrServiceOrderInfo['indus_pid'], 'indus_id,indus_pid,indus_name'); $reportUrl .= $arrBuyerInfo['uid']; } else { $reqPage = 'buyer'; $arrSellerInfo = kekezu::get_user_info($id); !$arrSellerInfo and kekezu::show_msg('用户订单不存在', 'index.php?do=seller&id=' . $id, 3, '订单已关闭', 'warning'); $arrOrderInfo['order_uid'] && $arrOrderInfo['order_uid'] != $uid and kekezu::show_msg('用户订单不存在', 'index.php?do=seller&id=' . $id, 3, '订单已关闭', 'warning'); $arrSellerInfo['comefrom'] = keke_shop_class::getUserAddress($id, 2, 1, 1, 0); $arrSellerInfo['userlevel'] = unserialize($arrSellerInfo['seller_level']); $arrSellerInfo['nearlyIncome'] = CommonClass::getNearlyIncomeForDays($arrSellerInfo['uid']); $arrAid = keke_user_mark_class::get_user_aid($arrSellerInfo['uid'], 2, null, '1'); $reportUrl .= $arrSellerInfo['uid']; } switch ($arrOrderInfo['order_status']) { case 'seller_confirm': $step = 'step2'; break; case 'wait': $step = 'step3'; break; case 'ok': $step = 'step4'; break; case 'working': if ($gUid == $id) { $step = 'step5';
function less_credit($value, $type) { $user_info = $this->_to_user_info; $uid = $user_info['uid']; if ($type == 1) { $sql = sprintf("update %switkey_space set buyer_credit = buyer_credit-%d where uid=%d", TABLEPRE, $value, $uid); $b_level = keke_user_mark_class::get_mark_level($user_info['buyer_credit'], 2); $up_sql = " UPDATE " . TABLEPRE . "witkey_space set buyer_level='" . serialize($b_level) . "' where uid=" . $uid; } elseif ($type == 2) { $sql = sprintf("update %switkey_space set seller_credit = seller_credit-%d where uid=%d", TABLEPRE, $value, $uid); $s_level = keke_user_mark_class::get_mark_level($user_info['seller_credit'], 1); $up_sql = " UPDATE " . TABLEPRE . "witkey_space set seller_level='" . serialize($s_level) . "' where uid=" . $uid; } db_factory::execute($up_sql); return db_factory::execute($sql); }
public function dispose_task() { global $_lang; $pass = true; if ($this->set_task_status(8)) { $task_info = $this->_task_info; $host_cash = $task_info['host_amount']; $rate = $task_info['profit_rate']; $profit = floatval($host_cash * $rate / 100); $get_cash = floatval($host_cash - $profit); keke_finance_class::cash_in($this->_guid, $task_info['deposit_cash'], 'deposit_return', '', 'task', $this->_task_id); $work_info = $this->work_exists(); $match_info = $this->get_match_work($work_info['work_id']); $data = array(':model_name' => $this->_model_name, ':task_id' => $this->_task_id, ':task_title' => $this->_task_title); keke_finance_class::init_mem('task_bid', $data); keke_finance_class::cash_in($work_info['uid'], $get_cash, 'task_bid', '', 'task', $this->_task_id, $profit); keke_finance_class::cash_in($work_info['uid'], $match_info['deposit_cash'], 'deposit_return', '', 'task', $this->_task_id); $this->plus_accepted_num($work_info['uid']); keke_user_mark_class::create_mark_log($this->_model_code, 1, $work_info['uid'], $this->_guid, $work_info['work_id'], $host_cash, $this->_task_id, $work_info['username'], $this->_gusername); keke_user_mark_class::create_mark_log($this->_model_code, 2, $this->_guid, $work_info['uid'], $work_info['work_id'], $get_cash, $this->_task_id, $this->_gusername, $work_info['username']); $this->plus_mark_num(); $w_notice = array($_lang['description'] => $_lang['hirer_has_acceptance_your_work'], $_lang['task_title'] => $this->_notice_url); $this->notify_user('match_task', $_lang['task_acceptance_ok'], $w_notice, 1, $work_info['uid']); $feed_arr = array("feed_username" => array("content" => $work_info['username'], "url" => "index.php?do=seller&id={$work_info['uid']}"), "action" => array("content" => $_lang['match_task_over'], "url" => ""), "event" => array("content" => $this->_task_title, "url" => $this->_task_url, 'cash' => number_format($get_cash, '2'))); kekezu::save_feed($feed_arr, $work_info['uid'], $work_info['username'], 'work_accept', $this->_task_id); } else { $pass = false; } return $pass; }
intval($hdn_mark_rule_id) and $mark_rule_obj->setWhere(" mark_rule_id = " . intval($hdn_mark_rule_id) . ""); $mark_rule_obj->setM_value(intval($txt_m_value)); $mark_rule_obj->setG_value(intval($txt_g_value)); $mark_rule_obj->setG_title($txt_g_title); $mark_rule_obj->setM_title($txt_m_title); $mark_rule_obj->setG_ico($hdn_g_ico); $mark_rule_obj->setM_ico($hdn_m_ico); if (intval($hdn_mark_rule_id)) { kekezu::admin_system_log($_lang['edit_mark_rule']); $res = $mark_rule_obj->edit_keke_witkey_mark_rule(); } else { kekezu::admin_system_log($_lang['create_mark_rule']); $res = $mark_rule_obj->create_keke_witkey_mark_rule(); } if ($res) { $u_list = db_factory::query(sprintf(" select buyer_credit,seller_credit,uid from %switkey_space", TABLEPRE)); if ($u_list) { $s = sizeof($u_list); for ($i = 0; $i < $s; $i++) { $b_level = keke_user_mark_class::get_mark_level($u_list[$i]['buyer_credit'], 2); $s_level = keke_user_mark_class::get_mark_level($u_list[$i]['seller_credit'], 1); $sql = " UPDATE " . TABLEPRE . "witkey_space set buyer_level='" . serialize($b_level) . "',seller_level='" . serialize($s_level) . "' where uid='{$u_list[$i]['uid']}'"; $sql != '' && db_factory::execute($sql); } } } kekezu::admin_show_msg($_lang['operate_notice'], $url, 2, $_lang['submit_success'], 'success'); } else { $mark_rule = $mark_rule_obj->query_keke_witkey_mark_rule(); require $kekezu->_tpl_obj->template(ADMIN_DIRECTORY . "/tpl/admin_{$do}_{$view}"); }
public function em_mark() { global $_lang; $aid = keke_user_mark_class::get_user_aid($this->_guid, 1, null, '1'); $str = ''; foreach ($aid as $k => $v) { $str .= '<p><span>' . $v['aid_name']; $str .= '<em class="cc00">' . $v['avg'] . $_lang['fen'] . '</em></span>'; $str .= keke_user_mark_class::gen_star2($v['avg']); $str .= '</p></span>'; } return $str; }
$arrSaleList = $arrSaleArr['sale_info']; $intCount = count($arrSaleList); $pages = $arrSaleArr['pages']; break; case "comment": $objComment = keke_comment_class::get_instance('service'); $arrCommentDatas = $objComment->get_comment_list($intId, $strUrl, $intPage); $arrCommentLists = $arrCommentDatas['data']; $strPage = $arrCommentDatas['pages']; $arrReplyLists = $objComment->get_reply_info($id); break; case "mark": $arrMarkCount = keke_shop_class::get_mark_count($model_code, $sid); $p['url'] = $strUrl . "&view=mark&intPagesize=" . $p['page_size'] . "&intPage=" . $p['page']; $p['anchor'] = '#pageT'; $w['model_code'] = $arrModelInfo['model_code']; $w['origin_id'] = $intId; $w['mark_status'] = $st; $w['mark_type'] = $ut; $arrMark = keke_user_mark_class::get_mark_info($w, $p, ' mark_id desc ', 'mark_status>0'); $arrMarkInfo = $arrMark['mark_info']; if (is_array($arrMarkInfo)) { foreach ($arrMarkInfo as $k => $v) { $arrMarkInfo[$k]['aidinfo'] = keke_user_mark_class::get_user_aid($v['by_uid'], $v['mark_type'], $v['mark_status'], 2, $v['model_code'], $v['obj_id']); } } $pages = $arrMark['pages']; break; default: break; }
<?php if (isset($formhash) && kekezu::submitcheck($formhash)) { if (strtoupper(CHARSET) == 'GBK') { $tar_content = kekezu::utftogbk($tar_content); } $tar_content = kekezu::escape($tar_content); $aid = implode(",", array_keys($star)); $aid_star = implode(",", array_values($star)); $res = keke_user_mark_class::exec_mark($markId, $tar_content, $mark_status, $aid, $aid_star); if ($markType == 'gz') { $strJumpUrl = 'index.php?do=user&view=gz&op=mark'; } elseif ($markType == 'wk') { $strJumpUrl = 'index.php?do=user&view=wk&op=mark'; } if ($res === true) { kekezu::show_msg('操作成功', $strJumpUrl, 3, NULL, 'ok'); } else { kekezu::show_msg($res, $strJumpUrl, 3, NULL, 'fail'); } } else { $arrMark = keke_user_mark_class::get_mark_info(array('model_code' => $code, 'obj_id' => $objId, 'by_uid' => $uid, 'uid' => $to_uid)); $markInfo = $arrMark['mark_info']['0']; $markInfo or kekezu::show_msg($_lang['operate_notice'], "", "", $_lang['mark_sya_busy_try_later'], "error"); $aidList = keke_user_mark_class::get_mark_aid($roleType); $aidInfo = keke_user_mark_class::get_user_aid($markInfo['by_uid'], $markInfo['mark_type'], $markInfo['mark_status'], 2, $markInfo['model_code'], $objId); } require keke_tpl_class::template("tpl/default/ajax/mark"); die;
public function auto_choose() { global $_K, $kekezu; global $_lang; switch ($this->_task_config['end_action']) { case "refund": $this->dispose_task_return(); break; case "split": $bid_uid = array(); $task_info = $this->_task_info; $split_num = intval($this->_task_config['witkey_num']); if ($split_num) { $single_cash = $task_info['task_cash'] / $split_num; $prom_obj = $objProm = keke_prom_class::get_instance(); $site_profit = $single_cash * $this->_profit_rate / 100; $cash = $single_cash - $site_profit; $split_style = $this->_task_config['auto_choose_rule']; if (in_array($split_style, array('work_time', 'take_num', 'seller_credit'))) { switch ($split_style) { case "work_time": $order_field = "a.work_time asc"; break; case "take_num": $order_field = "c.take_num desc"; break; case "seller_credit": $order_field = "c.seller_credit desc"; break; } $sql = "select a.*,b.oauth_id from %switkey_task_work a left join %switkey_member_oauth b on a.uid=b.uid\n\t\t\t\t\t\t\t\t\tleft join %switkey_space c on a.uid=c.uid\n\t\t\t\t\t\t\t\twhere a.task_id='%d' and a.work_status='0' order by %s,a.work_time asc limit 0,%d"; $work_list = db_factory::query(sprintf($sql, TABLEPRE, TABLEPRE, TABLEPRE, $this->_task_id, $order_field, $split_num)); $key = array_keys($work_list); $count = sizeof($key); for ($i = 0; $i < $count; $i++) { $data = array(':task_id' => $this->_task_id, ':task_title' => $this->_task_title); keke_finance_class::init_mem('task_bid', $data); keke_finance_class::cash_in($work_list[$i]['uid'], $cash, 'task_bid', '', 'task', $this->_task_id, $site_profit); $this->set_work_status($work_list[$i]['work_id'], 4); if ($prom_obj->is_meet_requirement("bid_task", $this->_task_id)) { $prom_obj->create_prom_event("bid_task", $work_list[$i]['uid'], $this->_task_id, $single_cash); $prom_obj->dispose_prom_event("bid_task", $work_list[$i]['uid'], $work_list[$i]['work_id']); } $url = '<a href ="' . $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id . '">' . $this->_task_title . '</a>'; $v = array($_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $url); $this->notify_user("auto_choose", $_lang['task_auto_choose_bid'], $v, 1, $work_list[$i]['uid']); keke_user_mark_class::create_mark_log($this->_model_code, '1', $work_list[$i]['uid'], $this->_guid, $work_list[$i]['work_id'], $single_cash, $this->_task_id, $work_list[$i]['username'], $this->_gusername); keke_user_mark_class::create_mark_log($this->_model_code, '2', $this->_guid, $work_list[$i]['uid'], $work_list[$i]['work_id'], $cash, $this->_task_id, $this->_gusername, $work_list[$i]['username']); $feed_arr = array("feed_username" => array("content" => $work_list[$i]['uid'], "url" => "index.php?do=seller&id={$work_list[$i]['uid']}"), "action" => array("content" => $_lang['success_bid_haved'], "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}", 'cash' => $cash)); kekezu::save_feed($feed_arr, $work_list[$i]['uid'], $work_list[$i]['username'], 'work_accept', $this->_task_id); $this->plus_accepted_num($work_list[$i]['uid']); $this->plus_mark_num(); $bid_uid[] = $work_list[$i]['uid']; } if ($split_num > $count) { $remain_cash = $task_info['task_cash'] - $count * $single_cash; $res = $this->dispose_auto_return($remain_cash); if ($res) { $v = array($_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $url); $this->notify_user("auto_choose", $_lang['task_auto_choose_work_and_return'], $v, 2, $this->_guid); } } $this->set_task_status(8); $prom_obj->dispose_prom_event("pub_task", $this->_guid, $this->_task_id); } elseif ($split_style == 'master_choose') { $this->set_task_status(7); } } else { $this->dispose_task_return(); } break; } $url = '<a href ="' . $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id . '">' . $this->_task_title . '</a>'; $v_arr = array($_lang['username'] => '$this->_gusername', $_lang['model_name'] => $this->_model_name, $_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $url); keke_msg_class::notify_user($this->_guid, $this->_gusername, 'auto_choose', $_lang['aito_choose_work_notice'], $v_arr, 1); }
} break; } } $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");
public function task_gs_timeout() { global $kekezu; global $_lang; $prom_obj = $objProm = keke_prom_class::get_instance(); if (time() > $this->_task_info['sp_end_time'] && $this->_task_info['task_status'] == 5) { $prize_work_arr = db_factory::query(sprintf("select * from %switkey_task_work where task_id='%d' and work_status in(1,2,3) ", TABLEPRE, $this->_task_id)); $prize_date = $this->get_prize_date(); $bid_uid = array(); foreach ($prize_work_arr as $k => $v) { $prize = "prize_" . $v['work_status']; $prize_cash = $prize_date['cash'][$prize]; $prize_real_cash = $prize_cash * (1 - $this->_task_config['task_rate'] / 100); $data = array(':task_id' => $this->_task_id, ':task_title' => $this->_task_title); keke_finance_class::init_mem('task_bid', $data); keke_finance_class::cash_in($v['uid'], $prize_real_cash, 'task_bid', '', 'task', $this->_task_id, $prize_cash - $prize_real_cash); $prize_total_cash += $prize_cash; $status_desc_arr = array("1" => $_lang['work_get_prize1'], "2" => $_lang['work_get_prize2'], "3" => $_lang['work_get_prize3']); $v_arr = array($_lang['username'] => $v['username'], $_lang['model_name'] => $this->_model_name, $_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $this->_task_title, $_lang['bid_cash'] => $prize_cash); $prom_obj->dispose_prom_event("bid_task", $v['uid'], $this->_task_id); keke_user_mark_class::create_mark_log($this->_model_code, 1, $v['uid'], $this->_guid, $v['work_id'], $prize_cash, $this->_task_id, $v['username'], $this->_gusername); keke_user_mark_class::create_mark_log($this->_model_code, 2, $this->_guid, $v['uid'], $v['work_id'], $prize_cash * (1 - $this->_task_config['task_rate'] / 100), $this->_task_id, $this->_gusername, $v['username']); $this->plus_mark_num(); $bid_uid[] = $v['uid']; } $this->set_task_status(8); $prom_obj->dispose_prom_event("pub_task", $this->_guid, $this->_task_id); $if_sy = $this->_task_info['task_cash'] - $prize_total_cash; if (intval($if_sy) > 0) { $return_g_cash = $if_sy * (1 - $this->_task_config['task_fail_rate'] / 100); $data = array(':model_name' => $this->_model_name, ':task_id' => $this->_task_id, ':task_title' => $this->_task_title); keke_finance_class::init_mem('task_remain_return', $data); keke_finance_class::cash_in($this->_guid, floatval($return_g_cash), 'task_remain_return', '', 'task', $this->_task_id, $if_sy - $return_g_cash); $v_arr = array($_lang['username'] => $this->_gusername, $_lang['model_name'] => $this->_model_name, $_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $this->_task_title, $_lang['reason'] => $_lang['gs_timeout_and_task_over_and_return_your_remain_cash']); keke_msg_class::notify_user($this->_guid, $this->_gusername, 'task_complete', $_lang['task_js'], $v_arr, 1); } else { $v_arr = array($_lang['username'] => $this->_gusername, $_lang['model_name'] => $this->_model_name, $_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $this->_task_title, $_lang['reason'] => $_lang['gs_timeout_and_task_complete']); keke_msg_class::notify_user($this->_guid, $this->_gusername, 'task_complete', $_lang['task_js'], $v_arr, 1); } } }
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'); } } }
function save_userinfo($reg_username, $reg_email, $reg_uid = null) { global $_K; $reg_username = kekezu::escape($reg_username); $slt = kekezu::randomkeys(6); $pwd = keke_user_class::get_password($this->_reg_pwd, $slt); $this->_member_obj->setUid($reg_uid); $this->_member_obj->setEmail($reg_email); $this->_member_obj->setUsername($reg_username); $this->_member_obj->setPassword($this->_reg_pwd); $this->_member_obj->setRand_code($slt); $reg_member_uid = $this->_member_obj->create_keke_witkey_member(); $this->_oltime_obj->setUid($reg_member_uid); $this->_oltime_obj->setUsername($reg_username); $this->_oltime_obj->setLast_op_time(time()); $this->_oltime_obj->setOnline_total_time(0); $this->_oltime_obj->create_keke_witkey_member_oltime(); if ($reg_member_uid) { $buyer_level = keke_user_mark_class::get_mark_level(0, '2'); $seller_level = keke_user_mark_class::get_mark_level('0', '1'); $this->_shop_obj->setShop_type(1); $this->_shop_obj->setUid($reg_member_uid); $this->_shop_obj->setUsername($reg_username); $this->_shop_obj->setShop_name($reg_username); $this->_shop_obj->setShop_status($_K['autoshop'] == '1' ? '1' : '3'); $res_shop_id = $this->_shop_obj->create_keke_witkey_shop(); $this->_space_obj->setUid($reg_member_uid); $this->_space_obj->setUsername($reg_username); $this->_space_obj->setPassword($this->_reg_pwd); $this->_space_obj->setSec_code($pwd); $this->_space_obj->setEmail($reg_email); $this->_space_obj->setReg_time(time()); $this->_space_obj->setReg_ip(keke_glob_class::checkipaddres($this->_reg_ip) ? $this->_reg_ip : '0.0.0.0'); $this->_space_obj->setBuyer_level(serialize($buyer_level)); $this->_space_obj->setSeller_level(serialize($seller_level)); $this->_space_obj->setAutoshop($_K['autoshop']); $space_id = $this->_space_obj->create_keke_witkey_space(); } $info = array('uid' => $reg_member_uid, 'username' => $reg_username, 'email' => $reg_email); if ($this->_sys_config['allow_reg_action'] != '1') { if ($reg_member_uid) { $arr = array(); $arr['用户名'] = $reg_username; $arr['网站名称'] = $kekezu->_sys_config['website_name']; keke_msg_class::notify_user($reg_member_uid, $reg_username, 'reg', '注册成功', $arr, '2'); } } else { keke_user_class::send_email_action_user($info); } return $reg_member_uid; }
$arrSellerMark = keke_user_mark_class::get_user_aid($arrSellerInfo['uid'], 2, null, 1); $arrFoundCount = kekezu::get_table_data(" sum(fina_cash) cash,sum(fina_credit) credit,count(fina_id) count,fina_action ", "witkey_finance", " uid=" . $arrSellerInfo['uid'] . " and fina_action in ('pub_task','task_bid','buy_service','sale_service','sale_gy') ", "", " fina_action ", "", "fina_action"); $arrFoundCount['task'] = number_format($arrFoundCount['task_bid']['cash'], 2); $arrFoundCount['goods'] = number_format($arrFoundCount['sale_service']['cash'] + $arrFoundCount['sale_gy']['cash'], 2); foreach ($arrSellerMark as $k => $v) { $arrSellerMark[$k]['star'] = intval($v['avg']); } } else { $arrBuyerLevel = unserialize($arrSellerInfo['buyer_level']); $arrBuyerLevel['next'] = intval($arrBuyerLevel['value'] + $arrBuyerLevel['level_up']); if ($arrBuyerLevel['next']) { $arrBuyerLevel['rate'] = intval($arrBuyerLevel['value'] / $arrBuyerLevel['next'] * 100); } else { $arrBuyerLevel['rate'] = 0; } $arrBuyerMark = keke_user_mark_class::get_user_aid($arrSellerInfo['uid'], 1, null, 1); $arrFoundCount = kekezu::get_table_data(" sum(fina_cash) cash,sum(fina_credit) credit,count(fina_id) count,fina_action ", "witkey_finance", " uid=" . $arrSellerInfo['uid'] . " and fina_action in ('pub_task','task_bid','buy_service','sale_service','buy_gy') ", "", " fina_action ", "", "fina_action"); $arrFoundCount['task'] = number_format($arrFoundCount['pub_task']['cash'], 2); $arrFoundCount['goods'] = number_format($arrFoundCount['buy_service']['cash'] + $arrFoundCount['buy_gy']['cash'], 2); foreach ($arrBuyerMark as $k => $v) { $arrBuyerMark[$k]['star'] = intval($v['avg']); } } $objTaskT = keke_table_class::get_instance('witkey_mark'); $strWhere .= ' uid=' . intval($arrSellerInfo['uid']) . ' and mark_status > 0 and mark_type = ' . intval($type); $page and $intPage = intval($page); $intPage = intval($intPage) ? $intPage : 1; $intPagesize = intval($intPagesize) ? $intPagesize : 15; $strWhere .= " order by mark_time desc"; $arrDatas = $objTaskT->get_grid($strWhere, $strUrl, $intPage, $intPagesize, null, null, null); $arrMarkLists = $arrDatas['data'];
public function plan_confirm($plan_id, $plan_step) { global $_K, $kekezu; global $_lang; $plan_ids = $this->get_plan_ids(); if (is_array($plan_ids) && in_array($plan_id, $plan_ids)) { $title_url = "<a href=\"" . $_K['siteurl'] . "/index.php?do=task&id=" . $this->_task_id . "\">" . $this->_task_title . "</a>"; $size = sizeof($plan_ids); if ($this->plan_cash($plan_id, $title_url)) { if (intval($plan_step) == $size) { $objProm = keke_prom_class::get_instance(); $objProm->dispose_prom_event("pub_task", $this->_guid, $this->_task_id); $objProm->dispose_prom_event("bid_task", $this->_bid_info['uid'], $this->_task_id); $this->set_task_status(8); $this->plus_mark_num(); $v_arr = array($_lang['username'] => $this->_gusername, $_lang['model_name'] => $this->_model_name, $_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $this->_task_title); keke_msg_class::notify_user($this->_guid, $this->_gusername, 'task_over', $_lang['task_over_notice'], $v_arr, 1); $sum = self::getTuoGuanCash($this->_task_id); keke_user_mark_class::create_mark_log($this->_model_code, '1', $this->_bid_info['uid'], $this->_guid, $this->_bid_info['bid_id'], $sum, $this->_task_id, $this->_bid_info['username'], $this->_gusername); $cash = floatval($sum) * (100 - intval($this->_task_info['profit_rate'])) / 100; keke_user_mark_class::create_mark_log($this->_model_code, '2', $this->_guid, $this->_bid_info['uid'], $this->_bid_info['bid_id'], $cash, $this->_task_id, $this->_gusername, $this->_bid_info['username']); } return true; } else { return true; } } else { return $_lang['the_plan_not_exist']; } }
public function work_choosed($work_info, $title_url) { global $_K, $kekezu; global $_lang, $_currencies, $currency; $objProm = keke_prom_class::get_instance(); $task_total_cash = floatval($this->_task_info['task_cash']); $task_real_cash = $task_total_cash * (1 - intval($this->_task_info['profit_rate']) / 100); $single_cash = floatval($this->_task_info['single_cash']); $real_cash = $task_real_cash / intval($this->_task_info['work_count']); $profit_cash = $single_cash - $real_cash; $data = array(':task_id' => $this->_task_id, ':task_title' => $this->_task_title); keke_finance_class::init_mem('task_bid', $data); keke_finance_class::cash_in($work_info['uid'], $real_cash, 'task_bid', '', 'task', $this->_task_id, $profit_cash); $url = '<a href ="' . $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id . '">' . $this->_task_title . '</a>'; $status_arr = self::get_work_status(); $v = array($_lang['work_status'] => $status_arr[6], $_lang['username'] => $work_info['username'], $_lang['website_name'] => $kekezu->_sys_config['website_name'], $_lang['task_id'] => $this->_task_id, $_lang['task_title'] => $url, $_lang['bid_cash'] => $_currencies[$currency]['symbol_left'] . $real_cash . $_currencies[$currency]['symbol_right']); $this->notify_user("task_bid", $_lang['work_bid'], $v, '1', $work_info['uid']); $feed_arr = array("feed_username" => array("content" => $work_info['username'], "url" => "index.php?do=seller&id={$work_info['uid']}"), "action" => array("content" => $_lang['success_bid_haved'], "url" => ""), "event" => array("content" => "{$this->_task_title}", "url" => "index.php?do=task&id={$this->_task_id}", 'cash' => number_format($real_cash, '2'))); kekezu::save_feed($feed_arr, $work_info['uid'], $work_info['username'], 'work_accept', $this->_task_id); $this->plus_accepted_num($work_info['uid']); $this->plus_mark_num(); $objProm = keke_prom_class::get_instance(); if ($objProm->is_meet_requirement("bid_task", $this->_task_id)) { $objProm->create_prom_event("bid_task", $work_info['uid'], $this->_task_id, $single_cash); $objProm->dispose_prom_event("bid_task", $work_info['uid'], $this->_task_id); } keke_user_mark_class::create_mark_log($this->_model_code, '1', $work_info['uid'], $this->_guid, $work_info['work_id'], $this->_task_info['single_cash'], $this->_task_id, $work_info['username'], $this->_gusername); keke_user_mark_class::create_mark_log($this->_model_code, '2', $this->_guid, $work_info['uid'], $work_info['work_id'], $real_cash, $this->_task_id, $this->_gusername, $work_info['username']); }
break; case 'comment': $objComment = keke_comment_class::get_instance('task'); $strUrl .= "&view=comment"; $arrCommentDatas = $objComment->get_comment_list($id, $strUrl, $page); $arrCommentLists = $arrCommentDatas['data']; $strPage = $arrCommentDatas['pages']; $arrReplyLists = $objComment->get_reply_info($id); break; case "mark": $p['page'] = $page; $p['page_size'] = $pagesize; $p['url'] = $strUrl . "&view=" . $view . "&page=" . $p['page'] . "&pagesize=" . ($p['page_size'] .= "&s=" . $s); $p['anchor'] = '#detail'; $w['model_code'] = $arrModelInfo['model_code']; $w['origin_id'] = $id; in_array($s, array(1, 2, 3)) and $w['mark_status'] = $s; $s == 101 and $w['mark_type'] = 2; $s == 102 and $w['mark_type'] = 1; $arrMarks = keke_user_mark_class::get_mark_info($w, $p, ' mark_id desc ', "mark_status>0"); $arrMarkInfo = $arrMarks['mark_info']; if (is_array($arrMarkInfo)) { $arrMarkLists = array(); foreach ($arrMarkInfo as $k => $v) { $arrMarkLists[$k] = $v; $arrAidInfos = keke_user_mark_class::get_user_aid($v['uid'], $v['mark_type'], $v['mark_status'], 1, null, $v['obj_id']); $arrMarkLists[$k]['aid'] = $arrAidInfos; } } $strPages = $arrMarks['pages']; }
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']; } } }
$strWhere = ' 1=1 '; $strWhere .= ' and a.seller_uid = ' . $gUid; $intModelId and $strWhere .= ' and a.model_id = ' . $intModelId; $strWhere .= ' and b.obj_type = ' . "'service'"; $page and $intPage = intval($page); $intPage = intval($intPage) ? $intPage : 1; $intPagesize = 10; $intId and $strWhere .= " and b.order_id=" . intval($intId); $strTitle and $strWhere .= " and a.order_name like '%" . trim($strTitle) . "%' "; if (isset($strStatus) && $strStatus != '' && $strStatus > -1 && in_array($strStatus, array_keys($arrStatus))) { $strWhere .= " and a.order_status ='" . strval($strStatus) . "'"; } else { $strStatus = -1; } $strOrder && in_array($strOrder, array_keys($arrListOrder)) and $strWhere .= " order by " . $strOrder or $strWhere .= " order by a.order_time desc"; if ($intModelId === 6) { $strOrderSql = ' SELECT a.order_name,a.model_id, a.seller_uid, a.seller_username,a.order_uid, a.order_username, a.order_amount, a.order_status, a.order_time, ' . ' b.*, c.service_id, c.title , c.price ' . ' 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 AS c ON b.obj_id = c.service_id ' . ' WHERE ' . $strWhere; } elseif ($intModelId == 7) { $strOrderSql = ' SELECT a.order_name,a.model_id, a.seller_uid, a.seller_username,a.order_uid, a.order_username, a.order_amount, a.order_status, a.order_time, ' . ' b.*, c.service_id, c.title , c.price ' . ' 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 ' . $strWhere; } else { $strOrderSql = ' SELECT a.order_name,a.model_id, a.seller_uid, a.seller_username,a.order_uid, a.order_username, a.order_amount, a.order_status, a.order_time, ' . ' b.*, c.service_id, c.title , c.price ,d.service_id as oservice_id, d.title as otitle, d.price as oprice' . ' 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 AS c ON b.obj_id = c.service_id ' . ' LEFT JOIN ' . TABLEPRE . 'witkey_service_order AS d ON b.order_id = d.order_id ' . ' WHERE ' . $strWhere; } $arrDatas = db_factory::query($strOrderSql); $arrPageArr = $kekezu->_page_obj->page_by_arr($arrDatas, $intPagesize, $intPage, $strUrl); $arrLists = $arrPageArr['data']; foreach ($arrLists as $k => $v) { $arrMark = keke_user_mark_class::get_mark_info(array('model_code' => $arrServiceModels[$intModelId]['model_code'], 'obj_id' => $v['order_id'], 'by_uid' => $gUid, 'uid' => $v['order_uid'])); $markInfo = $arrMark['mark_info']['0']; $arrLists[$k]['mark_status'] = $markInfo['mark_status']; } $strPages = $arrPageArr['page'];
$strPageKeyword = "({$arrSellerInfo['username']}的店铺,{$arrSellerInfo['username']}的案例)"; $strPageDescription = $arrSellerInfo['seo_desc']; } elseif ($view == 'mark' && $type == '2') { $strPageTitle = "能力等级-" . $shopTitle . "-" . $_K['html_title']; $strPageKeyword = "({$arrSellerInfo['username']}的店铺,{$arrSellerInfo['username']}的能力等级)"; $strPageDescription = $arrSellerInfo['seo_desc']; } else { $strPageTitle = "信誉等级-" . $shopTitle . "-" . $_K['html_title']; $strPageKeyword = "({$arrSellerInfo['username']}的店铺,{$arrSellerInfo['username']}的信誉等级)"; $strPageDescription = $arrSellerInfo['seo_desc']; } $incomeCash = db_factory::query(sprintf('SELECT sum(fina_cash) as cash FROM `' . TABLEPRE . 'witkey_finance` where to_days( NOW( ) ) - to_days( FROM_UNIXTIME( fina_time ) ) <=90 and fina_type="in" and (fina_action="sale_service" or fina_action="task_bid" or fina_action="sale_gy") and uid = %s', $arrSellerInfo['uid'])); $incomeCash = number_format($incomeCash[0][cash], 2); $arrAuthItems = keke_auth_fac_class::getAuthItemListByUid($id); $arrSellerLevel = unserialize($arrSellerInfo['seller_level']); $arrSellerMark = keke_user_mark_class::get_user_aid($arrSellerInfo['uid'], '2', null, '1'); foreach ($arrSellerMark as $k => $v) { $arrSellerMark[$k]['star'] = intval($v['avg']); } $arrFollow = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and fuid = %d', TABLEPRE . 'witkey_free_follow', intval($gUid), intval($arrSellerInfo['uid']))); if ($arrFollow) { $arrSellerInfo['follow'] = 1; } else { $arrSellerInfo['follow'] = 0; } unset($arrFollow); if ($closeshop) { keke_shop_release_class::closeShop($arrSellerInfo['uid'], 3); kekezu::show_msg("店铺已关闭", null, null, NULL, 'success'); die; }