public function __construct($task_info)
 {
     global $_K;
     parent::__construct($task_info);
     $this->_task_url = "<a href=\"{$_K['siteurl']}/index.php?do=task&id={$this->_task_id}\">{$this->_task_title}</a>";
     $this->init();
 }
Example #2
0
 public function __construct($task_info)
 {
     global $_K;
     parent::__construct($task_info);
     $siteurl = preg_replace("/localhost/i", "127.0.0.1", $_K['siteurl'], 1);
     $this->_task_url = $siteurl . '/index.php?do=task&id=' . $this->_task_id;
     $this->_notice_url = "<a href=\"{$this->_task_url}\">{$this->_task_title}</a>";
     $this->init();
 }
Example #3
0
 function run()
 {
     global $_K, $kekezu;
     $shop_time = new goods_time_class();
     $shop_time->validtaskstatus();
     $this->validautoMail();
     $model_list = $model_list ? $model_list : kekezu::get_table_data('*', 'witkey_model', 'model_status=1', '', null, '', 'model_id');
     $this->task_finish_auto_mark();
     foreach ($model_list as $model_info) {
         $model_dir = $model_info['model_dir'];
         if (file_exists(S_ROOT . "./task/{$model_dir}")) {
             $m = strtolower($model_dir) . "_time_class";
         }
         if (class_exists($m)) {
             $time_obj = new $m();
             $time_obj->validtaskstatus();
         }
     }
     keke_task_class::hp_timeout(7);
 }
 public function __construct($task_info)
 {
     parent::__construct($task_info);
     $this->_task_status == '6' || $this->_task_status == '8' and $this->_agree_id = db_factory::get_count(sprintf(" select agree_id from %switkey_agreement where task_id='%d'", TABLEPRE, $this->_task_id));
     $this->init();
 }
Example #5
0
 public function __construct($task_info)
 {
     parent::__construct($task_info);
     $this->init();
 }
Example #6
0
 public static function task_audit_pass($task_ids)
 {
     global $_lang, $kekezu;
     if ($task_ids && is_array($task_ids)) {
         $ids = implode(',', $task_ids);
         $task_arr = db_factory::query(sprintf("select task_id,model_id,task_title,task_cash,task_status,uid,username,start_time,sub_time,end_time,payitem_time,task_cash_coverage from %switkey_task where task_id in(%s) and task_status in (0,1)", TABLEPRE, $ids));
         foreach ($task_arr as $v) {
             kekezu::admin_system_log($_lang['audit_task'] . ":{$v['task_title']}" . $_lang['pass']);
             $payitem_add_time = time() - $v['start_time'];
             $payitem_arr = unserialize($v['payitem_time']);
             intval($payitem_arr['top']) > 0 or $top_add_time = false;
             intval($payitem_arr['urgent']) > 0 or $urgent_add_time = false;
             $payitem_time = keke_task_class::get_payitem($v['payitem_time'], $top_add_time, $urgent_add_time);
             $sub_time = time() + ($v['sub_time'] - $v['start_time']);
             $end_time = time() + ($v['end_time'] - $v['start_time']);
             $res = db_factory::execute(sprintf("update %switkey_task set task_status=2 ,start_time='%d',sub_time='%d',end_time='%d',payitem_time='%s'  where task_id in(%s)", TABLEPRE, time(), $sub_time, $end_time, $payitem_time, $v['task_id']));
             $_model_info = $kekezu->_model_list[$v['model_id']];
             if (in_array($_model_info['model_code'], array('sreward', 'mreward', 'preward'))) {
                 $task_cash = $v['task_cash'];
             } else {
                 $task_cash = $v['task_cash_coverage'];
             }
             $info = db_factory::get_one('select union_user,union_assoc from ' . TABLEPRE . 'witkey_space where uid=' . $v['uid']);
             $feed_arr = array("feed_username" => array("content" => $v['username'], "url" => "index.php?do=seller&id={$v['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$v['task_title']}", "url" => "index.php?do=task&id={$v['task_id']}", "cash" => $v['task_cash_coverage'] ? $v['task_cash_coverage'] : $v['task_cash'], "model_id" => "{$v['model_id']}"));
             kekezu::save_feed($feed_arr, $v['uid'], $v['username'], 'pub_task', $v['task_id']);
             PayitemClass::updateTopitem($v['task_id'], 'task');
         }
     } elseif ($task_ids) {
         $ids = $task_ids;
         $task_info = db_factory::get_one(sprintf("select task_id,model_id,task_title,task_cash_coverage,task_cash,task_status,uid,username,start_time,sub_time,end_time,payitem_time from %switkey_task where task_id = '%d' and task_status in (0,1)", TABLEPRE, $ids));
         $_model_info = $kekezu->_model_list[$task_info['model_id']];
         if ($task_info) {
             $payitem_add_time = time() - $task_info['start_time'];
             $payitem_arr = unserialize($task_info['payitem_time']);
             $payitem_arr['top'] > 1000000000 and $top_add_time = $payitem_add_time or $top_add_time = false;
             $payitem_arr['urgent'] > 1000000000 and $urgent_add_time = $payitem_add_time or $urgent_add_time = false;
             $payitem_time = keke_task_class::get_payitem($task_info['payitem_time'], $top_add_time, $urgent_add_time);
             $sub_time = time() + (intval($task_info['sub_time']) - intval($task_info['start_time']));
             $end_time = time() + ($task_info['end_time'] - $task_info['start_time']);
             $sql = sprintf("update %switkey_task set task_status=2 ,start_time='%d',sub_time='%d',end_time='%d',payitem_time='%s'  where task_id  ='%d' ", TABLEPRE, time(), $sub_time, $end_time, $payitem_time, $task_info['task_id']);
             $res = db_factory::execute($sql);
             if (in_array($_model_info['model_code'], array('sreward', 'mreward', 'preward'))) {
                 $task_cash = $task_info['task_cash'];
             } else {
                 $task_cash = $task_info['task_cash_coverage'];
             }
             $info = db_factory::get_one('select union_user,union_assoc from ' . TABLEPRE . 'witkey_space where uid=' . $task_info['uid']);
             kekezu::admin_system_log($_lang['audit_task'] . ":{$task_info['task_title']}" . $_lang['pass']);
             $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" => "{$task_info['model_id']}"));
             kekezu::save_feed($feed_arr, $task_info['uid'], $task_info['username'], 'pub_task', $task_info['task_id']);
             PayitemClass::updateTopitem($task_info['task_id'], 'task');
         }
     }
     return $res;
 }