public function tender_work_hand($work_info) { global $kekezu, $_K; global $_lang; if ($this->check_if_can_hand() === true) { $this->_task_bid_obj->setWhere("task_id = {$this->_task_id} and uid = {$this->_uid} and bid_status=0"); $is_hand = $this->_task_bid_obj->count_keke_witkey_task_bid(); if ($is_hand) { return $_lang['you_haved_tender']; } $this->_task_bid_obj->setUid($this->_uid); $this->_task_bid_obj->setUsername($this->_username); $this->_task_bid_obj->setArea($work_info['area']); $this->_task_bid_obj->setCycle($work_info['cycle']); $this->_task_bid_obj->setQuote($work_info['price']); $this->_task_bid_obj->setWork_hidden($work_info['work_hidden']); $this->_task_bid_obj->setTask_id($this->_task_id); $this->_task_bid_obj->setBid_time(time()); if ($this->_task_info['workhide'] == 1) { $this->_task_bid_obj->setWorkhide(1); } $this->_task_bid_obj->setMessage($work_info['tar_content']); $res = $this->_task_bid_obj->create_keke_witkey_task_bid(); $work_info['workhide'] == 1 and keke_payitem_class::payitem_cost("workhide", '1', 'work', 'spend', $res, $this->_task_id); $this->plus_work_num(); $this->plus_take_num(); $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['user'] => $this->_username, $_lang['call'] => $_lang['you'], $_lang['task_title'] => $url, $_lang['website_name'] => $kekezu->_sys_config['website_name']); keke_shop_class::notify_user($this->_guid, $this->_gusername, 'task_hand', $_lang['hand_work_notice'], $v_arr); $feed_arr = array("feed_username" => array("content" => $this->_uid, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '报名', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'task_baoming', $this->_task_id); $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '被报名', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($this->_task_id)); kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'task_baoming_bei', $this->_task_id); return true; } }
public function work_hand($work_desc, $file_ids, $hidework = '2', $work_hidden = '0') { global $_K; global $_lang; $resText = $this->check_if_can_hand(); if (true === $resText) { $work_obj = new Keke_witkey_task_work_class(); $work_obj->_work_id = null; $work_obj->setTask_id($this->_task_id); $work_obj->setUid($this->_uid); $work_obj->setUsername($this->_username); $work_obj->setVote_num(0); $work_obj->setWork_status(0); $work_obj->setWork_hidden($work_hidden); $work_obj->setWork_title($this->_task_title . $_lang['de_work']); if ($this->_task_info['workhide'] == 1) { $work_obj->setWorkhide(1); } $work_obj->setWork_desc(stripcslashes($work_desc)); $work_obj->setWork_time(time()); if ($file_ids) { $file_arr = array_unique(array_filter(explode(',', $file_ids))); $f_ids = implode(',', $file_arr); $work_obj->setWork_file(implode(',', $file_arr)); $work_obj->setWork_pic($this->work_pic($f_ids)); } $work_id = $work_obj->create_keke_witkey_task_work(); $hidework == '1' and keke_payitem_class::payitem_cost("workhide", '1', 'work', 'spend', $work_id, $this->_task_id); if ($work_id) { $f_ids and db_factory::execute(sprintf(" update %switkey_file set work_id='%d',task_title='%s',obj_id='%d' where file_id in (%s)", TABLEPRE, $work_id, $this->_task_title, $work_id, $f_ids)); $this->plus_work_num(); $this->plus_take_num(); $notice_url = "<a href=\"" . $_K['siteurl'] . "/index.php?do=task&id=" . $this->_task_id . "\">" . $this->_task_title . "</a>"; $g_notice = array($_lang['user'] => $this->_username, $_lang['call'] => $_lang['you'], $_lang['task_title'] => $notice_url); $this->notify_user("task_hand", $_lang['task_hand'], $g_notice); $feed_arr = array("feed_username" => array("content" => $this->_uid, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'task_tur', $this->_task_id); $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '被投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($this->_task_id)); kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'task_tur_bei', $this->_task_id); return true; } return '很遗憾,交稿失败'; } else { return $resText; } }
$arrSearch = db_factory::query("select * from " . TABLEPRE . "witkey_hotwords where words = '{$ky}'"); if ($arrHwStatus[0]['v'] == 'open') { if ($arrUpdateStatus[0]['v'] == 'auto') { if (count($arrSearch)) { db_factory::updatetable(TABLEPRE . "witkey_hotwords", array('count' => $arrSearch[0]['count'] + 1, 'time' => time()), array('words' => $arrSearch[0]['words'])); } else { db_factory::inserttable(TABLEPRE . "witkey_hotwords", array('words' => $ky, 'time' => time(), 'auto' => '1')); } } else { if (count($arrSearch)) { db_factory::updatetable(TABLEPRE . "witkey_hotwords", array('count' => $arrSearch[0]['count'] + 1, 'time' => time()), array('words' => $arrSearch[0]['words'], 'auto' => '0')); } } } } $arrPayitemConfig = keke_payitem_class::get_payitem_config(null, null, null, 'item_id'); $arrIndusAll = $kekezu->_indus_arr; $arrModelLabel = array(0 => '未知', 1 => '单人', 2 => '多人', 3 => '计件', 4 => '招标', 5 => '订金', 6 => '文件', 7 => '服务'); $page and $intPage = intval($page); $intPage = intval($intPage) ? $intPage : 1; $intPagesize = intval($intPagesize) ? $intPagesize : 10; $strSql = "select a.*,substring(payitem_time,instr(a.payitem_time,'top')+4+LENGTH('top'),10) as top_time\n\t\t from " . TABLEPRE . "witkey_service as a where "; $strWhere = " service_status=2 "; if (intval($i)) { $strWhere .= " and a.indus_id = " . intval($i); } if (intval($pd)) { $strWhere .= " and a.indus_pid = " . intval($pd); } if (intval($m)) { $strWhere .= " and a.model_id = " . intval($m);
case "freeze": $res = keke_task_config::task_freeze($task_id); break; case "unfreeze": $res = keke_task_config::task_unfreeze($task_id); break; case "pass": $res = keke_task_config::task_audit_pass(array($task_id)); break; case "nopass": $res = keke_task_config::task_audit_nopass($task_id); break; } } else { $process_arr = keke_task_config::can_operate($task_info['task_status'], $task_info['is_top']); $file_list = db_factory::query(sprintf(" select * from %switkey_file where task_id='%d' and obj_type='task' ", TABLEPRE, $task_id)); $status_arr = sreward_task_class::get_task_status(); $payitem_list = keke_payitem_class::get_payitem_config('employer'); $indus_arr = $kekezu->_indus_arr; $temp_arr = array(); $indus_option_arr = $indus_arr; kekezu::get_tree($indus_option_arr, $temp_arr, "option", $task_info['indus_id']); $indus_option_arr = $temp_arr; } if ($res) { kekezu::admin_show_msg($_lang['task_operate_success'], "index.php?do=model&model_id={$model_id}&view=list", 3, '', 'success'); } } else { require S_ROOT . '/task/' . $model_info['model_dir'] . '/admin/task_misc.php'; } require $kekezu->_tpl_obj->template('task/' . $model_info['model_dir'] . '/admin/tpl/task_edit_' . $op);
keke_payitem_class::update_service_payitem_time($service_info['payitem_time'], $add_time, $v); } $res = goods_shop_class::set_service_status($key_ids, 2); $action = $_lang['mulit_pass']; break; case $_lang['mulit_nopass']: $res = goods_shop_class::set_service_status($key_ids, 4); foreach ($key_ids as $v) { PayitemClass::refundPayitem($v, 'goods'); } $action = '批量审核不通过'; break; case $_lang['batch_shelves']: foreach ($key_ids as $v) { $service_info = kekezu::get_table_data("*", "witkey_service", "service_id = {$v}"); $service_info = $service_info['0']; $add_time = time() - $service_info['on_time']; keke_payitem_class::update_service_payitem_time($service_info['payitem_time'], $add_time, $v); } $res = goods_shop_class::set_service_status($key_ids, 2); $action = $_lang['shelves']; break; case $_lang['batch_off_the_shelf']: $res = goods_shop_class::set_service_status($key_ids, 3); $action = $_lang['off_the_shelf']; break; } $res and kekezu::admin_show_msg($_lang['mulit'] . $action . $_lang['success'], $url_str, 2, $_lang['mulit'] . $action . $_lang['success'], 'success') or kekezu::admin_show_msg($_lang['mulit'] . $action . $_lang['fail'], $url_str, 2, $_lang['mulit'] . $action . $_lang['fail'], "warning"); } } require keke_tpl_class::template('shop/' . $model_info['model_dir'] . '/admin/tpl/goods_' . $view);
public function bid_hand($quote, $cycle, $area, $work_desc, $plan_amount, $start_time, $end_time, $plan_title, $is_hide = 2, $work_hidden = '0') { global $_K; global $_lang; $resText = $this->check_bid(); if (true === $resText) { $resText = $this->check_if_can_hand(); if (true === $resText) { $bid_obj = new Keke_witkey_task_bid_class(); $bid_obj->_bid_id = null; $bid_obj->setTask_id($this->_task_id); $bid_obj->setUid($this->_uid); $bid_obj->setUsername($this->_username); $bid_obj->setBid_status(0); $bid_obj->setArea($area); $bid_obj->setQuote($quote); $bid_obj->setCycle($cycle); $bid_obj->setWork_hidden($work_hidden); if ($this->_task_info['workhide'] == 1) { $bid_obj->setWorkhide(1); } $bid_obj->setMessage($work_desc); $bid_obj->setBid_time(time()); $bid_id = $bid_obj->create_keke_witkey_task_bid(); $is_hide == '1' and keke_payitem_class::payitem_cost("workhide", '1', 'work', 'spend', $bid_id, $this->_task_id); if ($bid_id) { $size = sizeof($plan_amount); for ($i = 0; $i < $size; $i++) { $plan_info = array('plan_amount' => $plan_amount[$i], 'plan_desc' => '', 'plan_step' => $i + 1, 'plan_title' => $plan_title[$i], 'start_time' => strtotime($start_time[$i]), 'end_time' => strtotime($end_time[$i])); $this->plan_add($bid_id, $plan_info); } $this->plus_work_num(); $this->plus_take_num(); $notice_url = $this->_task_url; $g_notice = array($_lang['user'] => $this->_username, $_lang['call'] => $_lang['you'], $_lang['task_title'] => $notice_url); $this->notify_user("task_hand", $_lang['task_tender'], $g_notice, 2, $this->_guid); $feed_arr = array("feed_username" => array("content" => $this->_uid, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '报名', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'task_baoming', $this->_task_id); $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '被报名', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($this->_task_id)); kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'task_baoming_bei', $this->_task_id); return true; } else { return $_lang['sorry_tender_fail']; } } return $resText; } else { return $resText; } }
public function work_hand($work_desc, $file_ids, $hidework = '2', $work_hidden = '0', $url = '', $output = 'normal') { global $_lang; global $_K; $strText = $this->check_if_can_hand($url, $output); if ($strText === true) { $strCheckWork = $this->check_work_if_standard('hand'); if ($strCheckWork === true) { $work_obj = new Keke_witkey_task_work_class(); $work_obj->setHide_work($hidework); $work_obj->setTask_id($this->_task_id); $work_obj->setUid($this->_uid); $work_obj->setUsername($this->_username); $work_obj->setWork_desc(stripcslashes($work_desc)); $work_obj->setWork_status(0); $work_obj->setWork_hidden($work_hidden); $work_obj->setWork_title($this->_task_title); $work_obj->setWork_time(time()); if ($this->_task_info['workhide'] == 1) { $work_obj->setWorkhide(1); } if ($file_ids) { $file_arr = array_unique(array_filter(explode(',', $file_ids))); $f_ids = implode(',', $file_arr); $work_obj->setWork_file($f_ids); $work_obj->setWork_pic($this->work_pic($f_ids)); } $work_id = $work_obj->create_keke_witkey_task_work(); $hidework == '1' and keke_payitem_class::payitem_cost("workhide", '1', 'work', 'spend', $work_id, $this->_task_id); if ($work_id) { $f_ids and db_factory::execute(sprintf("update %switkey_file set work_id='%d',task_title='%s',obj_id='%d' where file_id in (%s)", TABLEPRE, $work_id, $this->_task_title, $work_id, $f_ids)); $this->plus_work_num(); $this->plus_take_num(); $notice_url = "<a href=\"{$_K['siteurl']}/index.php?do=task&id={$this->_task_id}\">{$this->_task_title}</a>"; $g_notice = array($_lang['user'] => $this->_username, $_lang['call'] => $_lang['you'], $_lang['task_title'] => $notice_url); $this->notify_user('task_hand', $_lang['task_hand'], $g_notice, '2', $this->_guid); $feed_arr = array("feed_username" => array("content" => $this->_uid, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'task_tur', $this->_task_id); $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => '被投稿', "url" => ""), "event" => array("content" => $this->_task_title, "url" => "index.php?do=task&id={$this->_task_id}")); $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_task where task_id=" . intval($this->_task_id)); kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'task_tur_bei', $this->_task_id); return true; } else { return $_lang['hand_work_fail_and_operate_agian']; } } else { return $_lang['hand_work_fail_for_the_work_full']; } } else { return $strText; } }
function get_payitem_str() { global $_K; $str = ''; $item_config = keke_payitem_class::get_payitem_config(null, null, null, 'item_id'); $item_arr = array_filter(explode(",", $this->_task_info['pay_item'])); if (!empty($item_arr) && is_array($item_arr)) { foreach ($item_arr as $v) { $item_config[$v]['item_code'] and $str .= $item_config[$v]['item_code'] . ','; } } return $str; }