mode_assetmlyAction.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * 此文件是流程模块【assetmly.固定资产领用】对应控制器接口文件。
  4. */
  5. class mode_assetmlyClassAction extends inputAction{
  6. /**
  7. * 重写函数:保存前处理,主要用于判断是否可以保存
  8. * $table String 对应表名
  9. * $arr Array 表单参数
  10. * $id Int 对应表上记录Id 0添加时,大于0修改时
  11. * $addbo Boolean 是否添加时
  12. * return array('msg'=>'错误提示内容','rows'=> array()) 可返回空字符串,或者数组 rows 是可同时保存到数据库上数组
  13. */
  14. protected function savebefore($table, $arr, $id, $addbo){
  15. $rows['type'] = 1; //必须为1
  16. return array(
  17. 'rows' => $rows
  18. );
  19. }
  20. /**
  21. * 重写函数:保存后处理,主要保存其他表数据
  22. * $table String 对应表名
  23. * $arr Array 表单参数
  24. * $id Int 对应表上记录Id
  25. * $addbo Boolean 是否添加时
  26. */
  27. protected function saveafter($table, $arr, $id, $addbo){
  28. }
  29. //读取资产列表
  30. public function assetmlydata()
  31. {
  32. $rows = m('assetm')->getall('`state`=0');
  33. $arr = array();
  34. foreach($rows as $k=>$rs){
  35. $arr[] = array(
  36. 'name' => $rs['title'].'('.$rs['num'].')',
  37. 'value' => $rs['id']
  38. );
  39. }
  40. return $arr;
  41. }
  42. }
粤ICP备19079148号