初始化

This commit is contained in:
2026-08-08 18:28:49 +08:00
parent 9bef4420e0
commit f082037a6e
854 changed files with 217171 additions and 11 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace app\models;
use core\base\Model;
/**
* 供应商模型
*/
class Supplier extends Model
{
protected $table = 'supplier';
public function getAll()
{
return $this->order(['id DESC'])->fetchAll();
}
public function getActiveList()
{
return $this->where(['status = 1'])->order(['name ASC'])->fetchAll();
}
public function getById($id)
{
return $this->where(['id = :id'], [':id' => $id])->fetch();
}
public function search($keyword)
{
return $this->where(
['name LIKE :kw OR contact_person LIKE :kw2 OR phone LIKE :kw3'],
[':kw' => "%{$keyword}%", ':kw2' => "%{$keyword}%", ':kw3' => "%{$keyword}%"]
)->order(['id DESC'])->fetchAll();
}
}