初始化
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace app\models;
|
||||
|
||||
use core\base\Model;
|
||||
|
||||
/**
|
||||
* 采购明细模型
|
||||
*/
|
||||
class PurchaseItem extends Model
|
||||
{
|
||||
protected $table = 'purchase_item';
|
||||
|
||||
public function getByOrder($orderId)
|
||||
{
|
||||
return $this->where(['order_id = :oid'], [':oid' => $orderId])->fetchAll();
|
||||
}
|
||||
|
||||
public function deleteByOrder($orderId)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . $this->getTable() . ' WHERE order_id = :oid';
|
||||
$stmt = $this->pdo->prepare($sql);
|
||||
return $stmt->execute([':oid' => $orderId]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user