SELECT * FROM com_product_extend WHERE pid = LIMIT 1
执行错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1

57.      {
58.          $this->arrSql[] = $sql;
59.          if( $result mysqli_query($this->conn$sql) ){
60.              return $result;
61.          }else{
62.              spError("{$sql}<br />执行错误: " mysqli_error($this->conn));
63.          }
64.      }
65.      
66.      /**
67.       返回影响行数
21.       
22.       * @param sql  执行的SQL语句
23.       */
24.      public function getArray($sql)
25.      {
26.          if( ! $result $this->exec($sql) )return array();
27.          if( ! mysqli_num_rows($result) )return array();
28.          $rows = array();
29.          while($rows[] = mysqli_fetch_array($resultMYSQLI_ASSOC)){}
30.          mysqli_free_result($result);
31.          array_pop($rows);
111.          }else{
112.              //$sort = "ORDER BY {$this->pk}"; //注释by lanying 使用默认排序提高查询性能
113.          }
114.          $sql "SELECT {$fields} FROM {$this->tbl_name} {$where} {$sort}";
115.          if(null != $limit)$sql $this->_db->setlimit($sql$limit);
116.          return $this->_db->getArray($sql);
117.      }
118.      
119.      /**
120.       不清缓存findALL函数
121.       */
65.       * @param sort    排序,等同于“ORDER BY ”
66.       * @param fields    返回的字段范围,默认为返回全部字段的值
67.       */
68.      public function find($conditions null$sort null$fields null)
69.      {
70.          if( $record $this->findAll($conditions$sort$fields1) ){
71.              return array_pop($record);
72.          }else{
73.              return FALSE;
74.          }
75.      }
13.       * @DateTime  2017-08-15T14:50:59+0800
14.       * @param     int                   $pid [分类的id]
15.       * @return    array|false                      
16.       */
17.      public function getProductExtend($pid){
18.          $extendData $this->find("pid = {$pid} ");
19.          if (!$extendData) {
20.              return false;
21.          }
22.          $data = array();
23.          //尺寸数据
674.                  $cache_id .= md5(json_encode($func_args[0]));
675.              }
676.              $cache_id .= md5(json_encode($func_args));
677.          }
678.          if( $cache_file spAccess('r'"sp_cache_{$cache_id}") )return unserialize$cache_file );
679.          return $this->cache_obj($cache_idcall_user_func_array(array($this->model_obj$func_name), $func_args), $this->input_args[0]);
680.      }
681.      /** 
682.       执行spModel子类对象的方法,并对返回结果进行缓存。
683.       *
684.       * @param obj    引用的spModel子类对象
375.              $this->goodsData $goodsData;
376.              $this->product $product;
377.              $this->productInfo $productInfo spClass('m_product')->spCache()->find("product = '{$product}'");
378.              $this->productData spClass('m_product')->spCache()->getClassifyData();
379.              $this->colorData = array('fffcfc','fffefa','fafffe');
380.              $extend spClass('m_product_extend')->spCache()->getProductExtend($productInfo['id']);
381.              if ($extend !== false) {
382.                  $this->jsonData $extend['data'];
383.                  $extend['extendData']['sizeDescription'] = str_replace('</br>'''$extend['extendData']['sizeDescription']);
384.                  $this->extendData $extend['extendData'];
385.              }
29.          header('location: /main/notfound.html');exit();
30.          eval($GLOBALS['G_SP']["dispatcher_error"]);
31.          exit;
32.      }
33.      // 路由并执行用户代码
34.      $handle_controller->$__action();
35.      // 控制器程序运行完毕,进行模板的自动输出
36.      if(FALSE != $GLOBALS['G_SP']['view']['auto_display']){
37.          $__tplname $__controller.$GLOBALS['G_SP']['view']['auto_display_sep'].
38.                  $__action.$GLOBALS['G_SP']['view']['auto_display_suffix']; // 拼装模板路径
39.          $handle_controller->auto_display($__tplname);
1.  <?php
2.  require(SP_PATH."/SpeedPHP.php");
3.  spRun();
1.  <?php
2.  header('Access-Control-Allow-Origin:*');
3.  $spConfig = require(dirname(dirname(__DIR__)) . '/config/config-pc.php');
4.  require(BASE_PATH."/index.php");