|
@@ -2,16 +2,10 @@
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
-use app\common\constant\ApplyConstant;
|
|
|
use app\common\constant\CommonConstant;
|
|
|
-use app\common\constant\ContractConstant;
|
|
|
-use app\common\constant\EvectionConstant;
|
|
|
-use app\common\constant\LeaveConstant;
|
|
|
use app\common\constant\MaintainConstant;
|
|
|
-use app\common\constant\OfferConstant;
|
|
|
-use app\common\model\ApproveMaintainUser;
|
|
|
use app\common\model\Goods;
|
|
|
-use app\common\model\GoodsCategory;
|
|
|
+use app\common\service\CommonService;
|
|
|
use app\common\service\GoodsCategoryService;
|
|
|
use app\common\service\UserService;
|
|
|
use hg\apidoc\annotation as Apidoc;
|
|
@@ -39,7 +33,7 @@ class Common extends Base
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 类型列表
|
|
|
+ * 类型数据
|
|
|
*
|
|
|
* @Apidoc\Method("POST")
|
|
|
* @Apidoc\Returned("module_list", type="array", desc="模块列表")
|
|
@@ -55,17 +49,7 @@ class Common extends Base
|
|
|
*/
|
|
|
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');
|
|
|
- $time_list = get_one_two_array(LeaveConstant::get_time_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", "time_list", "data1", "data2", "data5", "data6", "data8", "data9");
|
|
|
+ $data = CommonService::get_type_list();
|
|
|
$this->success('类型列表', $data);
|
|
|
}
|
|
|
|
|
@@ -84,7 +68,7 @@ class Common extends Base
|
|
|
$offset = $this->off_set;
|
|
|
$length = $this->page_num;
|
|
|
$user = $this->user;
|
|
|
- $list = UserService::get_list($offset, $length, $user);
|
|
|
+ $list = UserService::get_list($offset, $length);
|
|
|
$this->success('发起人列表', $list);
|
|
|
}
|
|
|
|
|
@@ -100,10 +84,7 @@ class Common extends Base
|
|
|
if (!array_key_exists($type, MaintainConstant::get_type_list())) {
|
|
|
$this->success('维修人员列表.');
|
|
|
}
|
|
|
- $list = ApproveMaintainUser::field('is_deleted',true)
|
|
|
- ->where('is_deleted',CommonConstant::IS_DELETED_0)
|
|
|
- ->where('type',$type)
|
|
|
- ->select();
|
|
|
+ $list = UserService::get_maintain_user($type);
|
|
|
$this->success('维修人员列表',$list);
|
|
|
}
|
|
|
|