zhanglinxin 1 year ago
parent
commit
4c28351f65

+ 5 - 5
application/api/controller/Approve.php

@@ -91,11 +91,11 @@ class Approve extends Base
      */
     public function get_list()
     {
-        $status = input('status');
-        $module = input('module');
-        $start_time = input('start_time');
-        $end_time = input('end_time');
-        $search = input('search');
+        $status = input('status') ?: 0;
+        $module = input('module') ?: 0;
+        $start_time = input('start_time') ?: '';
+        $end_time = input('end_time') ?: '';
+        $search = input('search') ?: '';
         $offset = $this->off_set;
         $length = $this->page_num;
         $user = $this->user;

+ 28 - 28
application/api/controller/Approveinfo.php

@@ -119,40 +119,40 @@ class Approveinfo extends Base
         $way = input('way') ?: '';
         $id = input('id') ?: 0;
         $module = input('module') ?: 0;
-        $apply_user_id = input('apply_user_id')?: '';
+        $apply_user_id = input('apply_user_id') ?: '';
         $reason = input('reason') ?: '';
         $type = input('type') ?: 0;
         $desc = input('desc') ?: '';
         $start_time = input('start_time');
         $end_time = input('end_time');
-        $document = input('document')?: '';
-        $images = input('images')?: '';
-        $remark = input('remark')?: '';
-        $total_amount = input('total_amount')?: 0;
-        $pay_type = input('pay_type')?: 0;
-        $word_size = input('word_size');
-        $apply_id = input('apply_id')?: 0;
-        $number = input('number')?: 0;
-        $is_who = input('is_who')?: 0;
-        $start_am = input('start_am');
-        $end_am = input('end_am');
-        $time = input('time');
-        $reach_address = input('reach_address');
-        $end_address = input('end_address');
-        $scope = input('scope');
-        $legal_opinion = input('legal_opinion');
-        $founder = input('founder');
-        $serial_number = input('serial_number');
+        $document = input('document') ?: '';
+        $images = input('images') ?: '';
+        $remark = input('remark') ?: '';
+        $total_amount = input('total_amount') ?: 0;
+        $pay_type = input('pay_type') ?: 0;
+        $word_size = input('word_size') ?: 0;
+        $apply_id = input('apply_id') ?: 0;
+        $number = input('number') ?: 0;
+        $is_who = input('is_who') ?: 0;
+        $start_am = input('start_am') ?: '';
+        $end_am = input('end_am') ?: '';
+        $time = input('time') ?: 0;
+        $reach_address = input('reach_address') ?: '';
+        $end_address = input('end_address') ?: '';
+        $scope = input('scope') ?: '';
+        $legal_opinion = input('legal_opinion') ?: '';
+        $founder = input('founder') ?: '';
+        $serial_number = input('serial_number') ?: '';
         $apply_date = input('apply_date');
-        $degree = input('degree');
-        $department = input('department');
-        $department_sign = input('department_sign');
-        $approve_user = input('approve_user');
-        $copy_user = input('copy_user');
-        $apply_goods = input('apply_goods');
-        $stock_goods = input('stock_goods');
-        $use_goods = input('use_goods');
-        $peer_user = input('peer_user');
+        $degree = input('degree') ?: 0;
+        $department = input('department') ?: '';
+        $department_sign = input('department_sign') ?: '';
+        $approve_user = input('approve_user') ?: '';
+        $copy_user = input('copy_user') ?: '';
+        $apply_goods = input('apply_goods') ?: [];
+        $stock_goods = input('stock_goods') ?: [];
+        $use_goods = input('use_goods') ?: [];
+        $peer_user = input('peer_user') ?: [];
         $params = compact("way", "id", "module", "apply_user_id", "reason", "type", "desc", "start_time", "end_time", "document", "images", "remark", "total_amount", "pay_type", "word_size", "apply_id", "number", "is_who", "start_am", "end_am", "time", "reach_address", "end_address", "scope", "legal_opinion", "founder", "serial_number", "apply_date", "degree", "department", "department_sign", "approve_user", "copy_user", "apply_goods", "stock_goods", "use_goods", "peer_user");
         $user = $this->user;
         if ($way == CommonConstant::edit) {

+ 1 - 77
application/common/model/ApproveFlow.php

@@ -29,80 +29,4 @@ class ApproveFlow extends Model
             });
     }
 
-
-    protected $module_desc = [
-        '1' => '请假',
-        '2' => '用车',
-        '3' => '出差',
-        '4' => '呈批',
-        '5' => '维修',
-        '6' => '学校文件',
-        '7' => '合同',
-    ];
-
-    // 获取审批人
-    public static function getApproveUser($module, $user_id)
-    {
-        $check_flow = ApproveFlow::where('user_id', $user_id)->where('type', 1)->where('module', $module)->find();
-        $where = [];
-        $where[] = ['l.type', '=', 1];
-        $where[] = ['l.module', '=', $module];
-        if ($check_flow) $where[] = ['l.sort', '>', $check_flow->sort];
-        $list = static::field('l.user_id,u.name user_name,u.headimg')->alias('l')
-            ->where($where)
-            ->order('l.sort asc')
-            ->leftJoin('StoreMember u', 'u.id = l.user_id')
-            ->select()->toArray();
-        return $list;
-    }
-
-    // 获取抄送人
-    public static function getCopyTo($module, $user_id)
-    {
-        $check_flow = ApproveFlow::where('user_id', $user_id)->where('type', 2)->where('module', $module)->find();
-        $where = [];
-        $where[] = ['l.type', '=', 2];
-        $where[] = ['l.module', '=', $module];
-        if ($check_flow) $where[] = ['l.sort', '>', $check_flow->sort];
-        $list = ApproveFlow::field('l.user_id,u.name user_name,u.headimg')
-            ->alias('l')
-            ->where($where)
-            ->order('l.sort asc')
-            ->leftJoin('StoreMember u', 'u.id = l.user_id')
-            ->select()->toArray();
-        return $list;
-    }
-
-
-    // 获取审批流程数据
-    public static function getApproveData($flow_user, $copy_user, $info_id)
-    {
-        $flow_data = [];// 审批流程
-        $flow_num = 0;
-        // 审批人
-        foreach (explode(',', $flow_user) as $fk => $fv) {
-            if (!$fv) continue;
-            $flow_num++;
-            $flow_data[] = [
-                'info_id' => $info_id,
-                'approve_user' => $fv,
-                'flow' => $flow_num,
-                'create_at' => date('Y-m-d H:i:s'),
-                'start_time' => $flow_num == 1 ? date('Y-m-d H:i:s') : null,
-                'status' => $flow_num == 1 ? 1 : 0,
-            ];
-        }
-        // 抄送人
-        foreach (explode(',', $copy_user) as $ck => $cv) {
-            if (!$cv) continue;
-            $flow_data[] = [
-                'info_id' => $info_id,
-                'approve_user' => $cv,
-                'approve_type' => 2
-            ];
-        }
-        return ['flow_data' => $flow_data, 'flow_num' => $flow_num];
-    }
-
-
-}
+}