phalapi中orm预处理

return $this->getORM()->select('*')->where('id = ?', $Id)->where('record=?',$record)->fetch();

return $this->getORM()->select('*')->where('id = ? and id > ? and id < ?',1,2,3)->fetch();

$importStatus = new ModelExpress();
// $res = $importStatus->getAll(['record' => "JdStoreBill' -- ",'id' => '10']);
$res = $importStatus->getAll(['record' => "JdStoreBill",'id' => '10']);
echo '<pre>';
print_r($res);

 

public function getAll($where){
echo '<pre>';
print_r($where);
$record = $where['record'];
$id = $where['id'];
// $sql = "select * from  express where record = '$record' and id = $id";
// echo $sql;
// return $this->getORM()->queryAll($sql);
return $this->getORM()->select('*')->where('record = ? and id > ?',$record,$id)->fetch();
}

 

public function getList($departmentID){
$sql = "SELECT
a.*
FROM
tbl a
WHERE
a.id = :departmentID";
$params=[":departmentID"=>$departmentID];
return $this->getORM()->queryAll($sql, $params);
}

    A+
发布日期:2025年03月04日  所属分类:php

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: