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(); } }