1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace app\common\model;
- use app\common\constant\CommonConstant;
- use think\Model;
- /**
- * 审批流程设置模型
- */
- class ApproveFlow extends Model
- {
- /**
- * 审批流程条件
- *
- * @param integer $module 模块类型
- * @param integer $flow_type 审批流类型:1=审批人,2=抄送人
- * @param integer $flow_item 审批流项:module=5出差类型,module=6请假周期,module=8维修类型
- **/
- public static function get_where($module, $flow_type, $flow_item)
- {
- return self::where('module', $module)
- ->where('flow_type', $flow_type)
- ->where(function ($query) use ($module, $flow_item) {
- if (in_array($module, [CommonConstant::MODULE_5, CommonConstant::MODULE_6, CommonConstant::MODULE_8])) {
- $query->where('flow_item', $flow_item);
- }
- });
- }
- }
|