Ejemplo n.º 1
0
 public function work_bid($contact, $quote, $tar_content, $cycle, $work_hidden = '0')
 {
     global $_lang;
     if (true) {
         $strNotice = $this->check_user_can_hand($url, $output);
         if ($strNotice === true) {
             $work_obj = new Keke_witkey_task_work_class();
             $work_obj->setTask_id($this->_task_id);
             $work_obj->setUid($this->_uid);
             $work_obj->setUsername($this->_username);
             $work_obj->setWork_status(4);
             $work_obj->setWork_title($this->_task_title);
             $work_obj->setWork_hidden($work_hidden);
             $work_obj->setWork_time(time());
             if ($this->_task_info['workhide'] == 1) {
                 $work_obj->setWorkhide(1);
             }
             $work_id = $work_obj->create_keke_witkey_task_work();
             $consume = kekezu::get_cash_consume($this->_task_config['deposit']);
             if ($work_id && $this->host_deposit_cash($work_id)) {
                 $this->set_task_status(3);
                 $this->plus_work_num();
                 $this->plus_take_num();
                 $match_obj = new Keke_witkey_task_match_work_class();
                 $match_obj->_mw_id = null;
                 $match_obj->setWork_id($work_id);
                 $match_obj->setWiki_deposit($this->_task_config['deposit']);
                 $match_obj->setDeposit_cash($this->_task_config['deposit']);
                 $match_obj->setWitkey_contact($contact);
                 $match_obj->setQuote($quote);
                 CHARSET == 'gbk' and $tar_content = kekezu::utftogbk($tar_content);
                 $match_obj->setQuote_desc(kekezu::escape($tar_content));
                 $match_obj->setCycle(intval($cycle));
                 $mw_id = $match_obj->create_keke_witkey_task_match_work();
                 db_factory::execute(sprintf("update %switkey_task set end_time = %d where task_id = %d", TABLEPRE, time() + 3600 * $this->_task_config['tuoguan_hour'], $this->_task_id));
                 $g_notice = array($_lang['description'] => $_lang['hav_new_bid_work'], $_lang['task_title'] => $this->_notice_url);
                 $this->notify_user('match_task', $_lang['work_hand_notice'], $g_notice);
                 return true;
             } else {
                 $work_obj->setWhere(" work_id = {$work_id}");
                 $work_obj->del_keke_witkey_task_work();
                 return $_lang['hand_work_fail_and_operate_agian'];
             }
         } else {
             return $strNotice;
         }
     } else {
         return $strText;
     }
 }