zhanglinxin il y a 1 an
Parent
commit
be9dcddc29

+ 26 - 88
application/api/controller/Common.php

@@ -24,94 +24,32 @@ class Common extends Base
     }
 
     /**
-     * 模块列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_module_list()
-    {
-        $this->success('模块列表', get_one_two_array(CommonConstant::get_module_list(), 'id', 'name'));
-    }
-
-    /**
-     * 缓急程度列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_degree_list()
-    {
-        $this->success('缓急程度列表', get_one_two_array(OfferConstant::get_degree_list(), 'id', 'name'));
-    }
-
-
-    /**
-     * 采购类型列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_apply_type_list()
-    {
-        $this->success('采购类型列表', get_one_two_array(ApplyConstant::get_type_list(), 'id', 'name'));
-    }
-
-    /**
-     * 采购支付方式列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_apply_pay_type_list()
-    {
-        $this->success('采购支付方式列表', get_one_two_array(ApplyConstant::get_pay_type_list(), 'id', 'name'));
-    }
-
-    /**
-     * 呈批类型列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_offer_type_list()
-    {
-        $this->success('呈批类型列表', get_one_two_array(OfferConstant::get_type_list(), 'id', 'name'));
-    }
-
-    /**
-     * 出差类型列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_evection_type_list()
-    {
-        $this->success('出差类型列表', get_one_two_array(EvectionConstant::get_type_list(), 'id', 'name'));
-    }
-
-    /**
-     * 请假类型列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_leave_type_list()
-    {
-        $this->success('请假类型列表', get_one_two_array(LeaveConstant::get_type_list(), 'id', 'name'));
-    }
-
-    /**
-     * 维修类型列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_maintain_type_list()
-    {
-        $this->success('维修类型列表', get_one_two_array(MaintainConstant::get_type_list(), 'id', 'name'));
-    }
-
-    /**
-     * 合同类型列表
-     *
-     * @Apidoc\Method("POST")
-     */
-    public function get_contract_type_list()
-    {
-        $this->success('合同类型列表', get_one_two_array(ContractConstant::get_type_list(), 'id', 'name'));
+     * 类型列表
+     *
+     * @Apidoc\Method("POST")
+     * @Apidoc\Returned("module_list", type="string", desc="模块列表")
+     * @Apidoc\Returned("degree_list", type="string", desc="缓急程度列表")
+     * @Apidoc\Returned("pay_type_list", type="string", desc="采购支付方式列表")
+     * @Apidoc\Returned("data1", type="string", desc="采购类型")
+     * @Apidoc\Returned("data2", type="string", desc="呈批类型")
+     * @Apidoc\Returned("data5", type="string", desc="出差类型")
+     * @Apidoc\Returned("data6", type="string", desc="请假类型")
+     * @Apidoc\Returned("data8", type="string", desc="维修类型")
+     * @Apidoc\Returned("data9", type="string", desc="合同类型")
+     */
+    public function get_type_list()
+    {
+        $module_list = get_one_two_array(CommonConstant::get_module_list(), 'id', 'name');
+        $degree_list = get_one_two_array(OfferConstant::get_degree_list(), 'id', 'name');
+        $pay_type_list = get_one_two_array(ApplyConstant::get_pay_type_list(), 'id', 'name');
+        $data1 = get_one_two_array(ApplyConstant::get_type_list(), 'id', 'name');
+        $data2 = get_one_two_array(OfferConstant::get_type_list(), 'id', 'name');
+        $data5 = get_one_two_array(EvectionConstant::get_type_list(), 'id', 'name');
+        $data6 = get_one_two_array(LeaveConstant::get_type_list(), 'id', 'name');
+        $data8 = get_one_two_array(MaintainConstant::get_type_list(), 'id', 'name');
+        $data9 = get_one_two_array(ContractConstant::get_type_list(), 'id', 'name');
+        $data = compact("module_list","degree_list","pay_type_list","data1","data2","data5","data6","data8","data9");
+        $this->success('类型列表', $data);
     }
 
 }

+ 3 - 1
application/common/constant/EvectionConstant.php

@@ -8,15 +8,17 @@ namespace app\common\constant;
 class EvectionConstant
 {
 
-    // 出差类型:1=市内,2=市外
+    // 出差类型:1=市内出差,2=市外出差,3=市内出差(需要报销)
     const TYPE_1 = '1';
     const TYPE_2 = '2';
+    const TYPE_3 = '3';
 
     public static function get_type_list()
     {
         return [
             self::TYPE_1 => '市内出差',
             self::TYPE_2 => '市外出差',
+            self::TYPE_3 => '市内出差(需要报销)',
         ];
     }
 }