Пример #1
0
 public static function task_audit_nopass($task_ids, $trust_response = false)
 {
     global $kekezu;
     global $_lang;
     if ($task_ids && is_array($task_ids)) {
         $ids = implode(',', $task_ids);
         $task_arr = db_factory::query(sprintf("select * from %switkey_task where task_id in(%s)", TABLEPRE, $ids));
         foreach ($task_arr as $v) {
             if ($v['model_id'] == '4' || $v['model_id'] == 5) {
                 $return_cash = $v['real_cash'];
             } else {
                 $return_cash = $v['task_cash'];
             }
             $model_info = $kekezu->_model_list[$v['model_id']];
             $class_name = $model_info['model_code'] . "_task_class";
             $obj = new $class_name($v);
             $task_config = $obj->_task_config;
             $res = db_factory::execute(sprintf("update %switkey_task set task_status=10 where task_id ='%d' ", TABLEPRE, $v['task_id']));
             $data = array(':model_name' => $kekezu->_model_list[$v['model_id']]['model_name'], ':task_id' => $v['task_id'], ':task_title' => $v['task_title']);
             keke_finance_class::init_mem('task_fail', $data);
             if ($v['task_status'] == 1) {
                 PayitemClass::refundPayitem($v['task_id'], 'task');
                 keke_finance_class::cash_in($v['uid'], $return_cash, 'task_fail', 'admin', 'task', $v['task_id']);
             }
             kekezu::admin_system_log($_lang['audit_task'] . ":{$v['task_title']}" . $_lang['not_pass']);
         }
     } elseif ($task_ids) {
         $ids = $task_ids;
         $task_info = db_factory::get_one(sprintf("select task_id,task_title,task_status,task_cash,real_cash,model_id,uid,is_trust,trust_type,model_id from %switkey_task where task_id = '%d'", TABLEPRE, $ids));
         if ($task_info) {
             if ($task_info['is_trust'] && $trust_response == false) {
                 $trust_data['refund'] = array($ids, $task_info['task_cash']);
                 $jump_url = keke_trust_fac_class::trust_task_request("pt_refund", $kekezu->_model_list[$task_info['model_id']]['model_dir'], $ids, $task_info['trust_type'], $trust_data);
                 header("Location:" . $jump_url);
                 die;
             } else {
                 $res = db_factory::execute(sprintf("update %switkey_task set task_status=10 where task_id  ='%d' ", TABLEPRE, $ids));
                 switch ($task_info['is_trust']) {
                     case "1":
                         $fina_cash = $task_info['task_cash'];
                         $data = array("uid" => $task_info['uid'], "username" => $task_info['username'], "obj_id" => $ids, "fina_cash" => $fina_cash, "fina_time" => time(), "fina_action" => "task_fail");
                         keke_finance_class::finance_trust($data, $task_info['trust_type'], 'in');
                         break;
                     case "0":
                         if ($task_info['model_id'] == '4' || $task_info['model_id'] == 5) {
                             $return_cash = $task_info['real_cash'];
                         } else {
                             $return_cash = $task_info['task_cash'];
                         }
                         $model_info = $kekezu->_model_list[$task_info['model_id']];
                         $class_name = $model_info['model_code'] . "_task_class";
                         $obj = new $class_name($task_info);
                         $task_config = $obj->_task_config;
                         $data = array(':model_name' => $kekezu->_model_list[$v['model_id']]['model_name'], ':task_id' => $task_info['task_id'], ':task_title' => $task_info['task_title']);
                         keke_finance_class::init_mem('task_fail', $data);
                         if ($task_info['task_status'] == 1) {
                             PayitemClass::refundPayitem($task_info['task_id'], 'task');
                             keke_finance_class::cash_in($task_info['uid'], $return_cash, 'task_fail', 'admin', 'task', $task_info['task_id']);
                         }
                         break;
                 }
                 kekezu::admin_system_log($_lang['audit_task'] . ":{$task_info['task_title']}" . $_lang['not_pass']);
             }
         }
     }
     return $res;
 }
 function pt_refund($is_return = false, $data_detail = array())
 {
     global $_K;
     $task_info = $this->_task_info;
     switch ($is_return) {
         case false:
             $extra_info['refund_detail'] = $data_detail['refund'];
             $extra_info['platform_detail'] = $data_detail['platform'];
             $extra_info['transfer_detail'] = $data_detail['transfer'];
             return keke_trust_fac_class::redirect_to_alipay($this->_interface, 'alipay_trust', $this->_task_info, $extra_info);
             break;
         case true:
             switch ($this->_data['refund_detail']['transfer_status']) {
                 case "W":
                     $task_obj = sreward_task_class::get_instance($this->_task_info);
                     if ($this->_task_info['task_status'] == '9') {
                         $res = $task_obj->dispose_task_return(true);
                     }
                     break;
                 case "F":
                     keke_trust_fac_class::notify($this->_task_url, keke_trust_fac_class::output_error($this->_error), 'fail', $this->_task_id);
                     break;
             }
             break;
     }
 }