thinkphp5 Invalid parameter number

浏览:423 发布日期:2018/09/04 分类:求助交流 关键字: TP5.1 mysql php
TP 查询 报错SQLSTATE[HY093]: Invalid parameter number

导出原始sql 在linux 上执行没有任何问题 try{
            $t=$table->alias('d')->field($field);
            if(!empty($condition)){
                if(isset($condition['where'])&&!empty($condition['where']))
                    $t->where($condition['where']);
                if(!empty($whereOr)){
                    $t->whereOr(function($query) use ($whereOr){
                        $query->where($whereOr);
                    });

                }
                if(isset($condition['order'])&&!empty($condition['order']))
                    $t->order($condition['order']);
                $t->limit(($page-1)* $limit,$limit);
            }
            $result= Collection($t->select())->toArray();
        }catch(\Exception $e){
            $this->code=-1;
            $this->msg=$e;
            return $this->output();
        }catch(\Error $e){
            $this->code=-1;
            $this->msg=$e;
            return $this->output();
        }
        if(empty($result)){
            $this->code=-2;
        }
        else{
            $this->data=$result;
        }
        return $this->output();
}
生成的sql

SELECT * FROM `de_dispute` `d` WHERE `seller_response_due_date` BETWEEN 1 AND 1536076799 AND `status` = 'WAITING_FOR_SELLER_RESPONSE' AND `is_reply` = 1 OR ( `seller_response_due_date` BETWEEN 1 AND 1536076799 AND `status` = 'OPEN' AND `is_reply` = 1 AND `dispute_life_cycle_stage` = 'CHARGEBACK' ) ORDER BY `reply_status` asc,`seller_response_due_date` asc LIMIT 0,50

大神求助??????????????
最佳答案
评论( 相关
后面还有条评论,点击查看>>