初始化

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
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace app\models;
use core\base\Model;
/**
* 工位模型
*/
class Workstation extends Model
{
protected $table = 'workstation';
// 获取所有工位(按排序)
public function getAll()
{
return $this->order(['sort_order ASC'])->fetchAll();
}
// 添加工位
public function addStation($data)
{
return $this->add($data);
}
// 更新工位
public function updateStation($id, $data)
{
return $this->where(['id = :id'], [':id' => $id])->update($data);
}
// 删除工位
public function deleteStation($id)
{
return $this->delete($id);
}
// 更新排序
public function updateSort($id, $sort_order)
{
return $this->where(['id = :id'], [':id' => $id])->update(['sort_order' => $sort_order]);
}
// 根据类型获取工位
public function getByType($station_type)
{
return $this->where(['station_type = :type'], [':type' => $station_type])->fetch();
}
}