doulan4371 2017-02-01 05:58
浏览 32

我需要显示哪些文件丢失了? 在前端用户视图中。 我有一个未定义偏移的错误:在codeigniter中为0。

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: models/Admin_user.php

Line Number: 1010

Backtrace:

File: /var/app/current/application/models/Admin_user.php Line: 1010 Function: _error_handler

File: /var/app/current/application/controllers/Adminuser.php Line: 427 Function: force_recheck

File: /var/app/current/index.php Line: 319 Function: require_once

   public function force_recheck($jid)
   {
       $status=0;
       $job_details=$this->db->query("SELECT * FROM prins_job_details WHERE jid='".$jid."' AND (status='-1' OR status='2')")->result();
       $agent_details=$this->db->get_where('prins_agents',array('agent_id'=>$job_details[0]->agent_id))->result();
       $s3_list=$this->listobject($job_details[0]->s3_path,$agent_details[0]->bucket_name);
       if($job_details[0]->json_list != $s3_list['count'])
       {
           $keys=$s3_list['keys'];
           for($i=0;$i<$s3_list['count'];$i++)
           {
               $position=strrpos($keys[$i]['Key'],"/");
               $name=substr($keys[$i]['Key'],$position + 1);
               $s3_keys[]=$name; 
           }
           $dynamic_fields=json_decode($job_details[0]->dynamic_fields,true);
           for($j=0;$j<count($dynamic_fields);$j++)
           {
               if($dynamic_fields[$j]['typevalue']=='image' || $dynamic_fields[$j]['typevalue']=='video')
               {
                  $json_keys[]=$dynamic_fields[$j]['value'];  
               }

           }
           $missing_key=array_diff($json_keys,$s3_keys);

           $template='<div class="row-fluid">';
               $template .='<div class="col-md-12 col-sm-12 center">';
                    $template .='<table class="table table-striped table-bordered bulk_action">';
                    $template .='<tr>';
                    $template .='<th>These Files are Not uploaded</th';
                    $template .='</tr>';
                    $template .='<tr>';
                    $template .='<th class="center">Missing Files</th';
                    $template .='</tr>';
                    for($n=0;$n<count($missing_key);$n++)
                    {
                        $template .='<tr><td class="prins-warning">';
                        $template .=$missing_key[$n]; // line number 1010 error
                        $template .='</td></tr>';    //undefined offset error
                    }
                    $template .='</table>';
               $template .='</div>';
           $template .='</div>';
           return $template;
       }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计