if(count($br_code)>0){
$br_where = array();
foreach ($br_code as $code)
{
array_push($br_where, "asr_product_code LIKE '$code%'");
}
array_push($where,"(".implode(" OR ", $br_where).")");
}array_push($where,"(".implode(" OR ", $br_where).")"); 这行提示
A PHP Error was encounteredSeverity: WarningMessage: array_push() expects parameter 1 to be array, null givenFilename: controllers/csv.phpLine Number: 109
$br_where = array();
foreach ($br_code as $code)
{
array_push($br_where, "asr_product_code LIKE '$code%'");
}
array_push($where,"(".implode(" OR ", $br_where).")");
}array_push($where,"(".implode(" OR ", $br_where).")"); 这行提示
A PHP Error was encounteredSeverity: WarningMessage: array_push() expects parameter 1 to be array, null givenFilename: controllers/csv.phpLine Number: 109
$where变量的处理请贴出来一起看看,这个提示的含义是$where变量没有被赋值过。如果没有处理过$where,应该进行初始化 $where = array();
SELECT ".(implode(',',$field))."
FROM {$this->table} AS `a`
LEFT OUTER JOIN `taobao_shujubao` AS `b` ON `a`.`asr_product_seq`=`b`.`fk_reseller_product_seq`
".(count($where) > 0 ? ' WHERE '.implode(' AND ',$where) : '')."
{$this->order}
{$this->limit}
) AS a
GROUP BY asr_product_seq该行的语句最后出来的是
/* [models] - 60 */ SELECT * FROM ( SELECT `b`.`taobao_shujubao_data`,`b`.`taobao_shujubao_insert_time`,`b`.`taobao_shujubao_update_time` FROM asr_product AS `a` LEFT OUTER JOIN `taobao_shujubao` AS `b` ON `a`.`asr_product_seq`=`b`.`fk_reseller_product_seq` ORDER BY ORDER BY asr_product_code ASC, asr_product_seq DESC LIMIT 0, 1 ) AS a GROUP BY asr_product_seq
//////////////////////////////////////////////////
A Database Error OccurredError Number: 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY asr_product_code ASC, asr_product_seq DESC LIMIT 0, 1 ) AS a ' at line 7