ApproveFlow.php 898 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. use app\common\constant\CommonConstant;
  4. use think\Model;
  5. /**
  6. * 审批流程设置模型
  7. */
  8. class ApproveFlow extends Model
  9. {
  10. /**
  11. * 审批流程条件
  12. *
  13. * @param integer $module 模块类型
  14. * @param integer $flow_type 审批流类型:1=审批人,2=抄送人
  15. * @param integer $flow_item 审批流项:module=5出差类型,module=6请假周期,module=8维修类型
  16. **/
  17. public static function get_where($module, $flow_type, $flow_item)
  18. {
  19. return self::where('module', $module)
  20. ->where('flow_type', $flow_type)
  21. ->where(function ($query) use ($module, $flow_item) {
  22. if (in_array($module, [CommonConstant::MODULE_5, CommonConstant::MODULE_6, CommonConstant::MODULE_8])) {
  23. $query->where('flow_item', $flow_item);
  24. }
  25. });
  26. }
  27. }