Index.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <?php
  2. /**
  3. +-----------------------------------------------------------------------------------------------
  4. * GouGuOPEN [ 左手研发,右手开源,未来可期!]
  5. +-----------------------------------------------------------------------------------------------
  6. * @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
  7. +-----------------------------------------------------------------------------------------------
  8. * @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
  9. +-----------------------------------------------------------------------------------------------
  10. * @Author 勾股工作室 <hdm58@qq.com>
  11. +-----------------------------------------------------------------------------------------------
  12. */
  13. declare (strict_types = 1);
  14. namespace app\api\controller;
  15. use app\api\BaseController;
  16. use app\api\model\EditLog;
  17. use smsservice\Smsservice;
  18. use think\Image; // 引入Image类
  19. use think\facade\Db;
  20. class Index extends BaseController
  21. {
  22. //上传文件
  23. public function upload()
  24. {
  25. if (request()->isPost()) {
  26. $param = get_params();
  27. $sourse = 'file';
  28. if(isset($param['sourse'])){
  29. $sourse = $param['sourse'];
  30. }
  31. if($sourse == 'file' || $sourse == 'tinymce'){
  32. if(request()->file('file')){
  33. $file = request()->file('file');
  34. }
  35. else{
  36. return to_assign(1, '没有选择上传文件');
  37. }
  38. }
  39. else{
  40. if (request()->file('editormd-image-file')) {
  41. $file = request()->file('editormd-image-file');
  42. } else {
  43. return to_assign(1, '没有选择上传文件');
  44. }
  45. }
  46. // 获取上传文件的hash散列值
  47. $sha1 = $file->hash('sha1');
  48. $md5 = $file->hash('md5');
  49. $rule = [
  50. 'image' => 'jpg,png,jpeg,gif',
  51. 'doc' => 'txt,doc,docx,ppt,pptx,xls,xlsx,pdf',
  52. 'file' => 'zip,gz,7z,rar,tar',
  53. 'video' => 'mpg,mp4,mpeg,avi,wmv,mov,flv,m4v',
  54. 'audio' => 'mp3,wav,wma,flac,midi',
  55. ];
  56. $fileExt = $rule['image'] . ',' . $rule['doc'] . ',' . $rule['file'] . ',' . $rule['video'] . ',' . $rule['audio'];
  57. //1M=1024*1024=1048576字节
  58. $file_size = get_system_config('system','upload_max_filesize');
  59. if(!isset($file_size)){
  60. $file_size=50;
  61. }
  62. $fileSize = $file_size * 1024 * 1024;
  63. if (isset($param['type']) && $param['type']) {
  64. $fileExt = $rule[$param['type']];
  65. }
  66. if (isset($param['size']) && $param['size']) {
  67. $fileSize = $param['size'];
  68. }
  69. $validate = \think\facade\Validate::rule([
  70. 'image' => 'require|fileSize:' . $fileSize . '|fileExt:' . $fileExt,
  71. ]);
  72. $file_check['image'] = $file;
  73. if (!$validate->check($file_check)) {
  74. return to_assign(1, $validate->getError());
  75. }
  76. // 日期前綴
  77. $dataPath = date('Ym');
  78. $use = 'thumb';
  79. $filename = \think\facade\Filesystem::disk('public')->putFile($dataPath, $file, function () use ($md5) {
  80. return set_salt(5).'_'.$md5;
  81. });
  82. if ($filename) {
  83. //写入到附件表
  84. $imagePath = get_config('filesystem.disks.public.url'). '/' . $filename;
  85. $thumbPath = '';
  86. if(in_array($file->extension(),['jpg','png','jpeg','gif'])){
  87. // 生成等比缩略图
  88. $image = Image::open(request()->file('file'));
  89. $thumbPath = dirname($imagePath) . '/thumb_' . basename($imagePath);
  90. // 生成等比缩略图保存到指定位置,这里设置最大宽度为360px, 高度自适应
  91. $image->thumb(360,360,Image::THUMB_CENTER)->save('./'.$thumbPath);
  92. }
  93. $data = [];
  94. $data['filepath'] = $imagePath;
  95. $data['thumbpath'] = $thumbPath;
  96. $data['name'] = $file->getOriginalName();
  97. $data['mimetype'] = $file->getOriginalMime();
  98. $data['fileext'] = $file->extension();
  99. $data['filesize'] = $file->getSize();
  100. $data['filename'] = $filename;
  101. $data['sha1'] = $sha1;
  102. $data['md5'] = $md5;
  103. $data['module'] = \think\facade\App::initialize()->http->getName();
  104. $data['action'] = app('request')->action();
  105. $data['uploadip'] = app('request')->ip();
  106. $data['create_time'] = time();
  107. $data['user_id'] = $this->uid;
  108. if ($data['module'] = 'admin') {
  109. //通过后台上传的文件直接审核通过
  110. $data['status'] = 1;
  111. $data['admin_id'] = $data['user_id'];
  112. $data['audit_time'] = time();
  113. }
  114. $data['use'] = request()->has('use') ? request()->param('use') : $use; //附件用处
  115. $res['id'] = Db::name('file')->insertGetId($data);
  116. $res['filepath'] = $data['filepath'];
  117. $res['name'] = $data['name'];
  118. $res['uid'] = $this->uid;
  119. $res['filename'] = $data['filename'];
  120. $res['filesize'] = $data['filesize'];
  121. $res['fileext'] = $data['fileext'];
  122. add_log('upload', $data['user_id'], $data,'文件');
  123. if($sourse == 'editormd'){
  124. //editormd编辑器上传返回
  125. return json(['success'=>1,'message'=>'上传成功','url'=>$data['filepath']]);
  126. }
  127. else if($sourse == 'tinymce'){
  128. //tinymce编辑器上传返回
  129. return json(['success'=>1,'message'=>'上传成功','location'=>$data['filepath']]);
  130. }
  131. else{
  132. //普通上传返回
  133. return to_assign(0, '上传成功', $res);
  134. }
  135. }
  136. else {
  137. return to_assign(1, '上传失败,请重试');
  138. }
  139. }
  140. else{
  141. return to_assign(1, '非法请求');
  142. }
  143. }
  144. //执行分块上传的控制器方法
  145. public function chunkUpload() {
  146. if ($this->request->isPost()) {
  147. //执行分块上传流程
  148. $data = $this->request->post();
  149. //判断是否是分块上传
  150. if ($data['type'] === 'chunk') {
  151. $file = request()->file('file');
  152. $rule = [
  153. 'image' => 'jpg,png,jpeg,gif',
  154. 'doc' => 'txt,doc,docx,ppt,pptx,xls,xlsx,pdf',
  155. 'file' => 'zip,gz,7z,rar,tar',
  156. 'video' => 'mpg,mp4,mpeg,avi,wmv,mov,flv,m4v',
  157. 'audio' => 'mp3,wav,wma,flac,midi',
  158. ];
  159. $fileExt = $rule['image'] . ',' . $rule['doc'] . ',' . $rule['file'] . ',' . $rule['video'] . ',' . $rule['audio'];
  160. //1M=1024*1024=1048576字节
  161. $file_size = get_system_config('system','upload_max_filesize');
  162. if(!isset($file_size)){
  163. $file_size=50;
  164. }
  165. $fileSize = $file_size * 1024 * 1024;
  166. $validate = \think\facade\Validate::rule([
  167. 'image' => 'require|fileSize:' . $fileSize . '|fileExt:' . $fileExt,
  168. ]);
  169. $file_check['image'] = $file;
  170. if (!$validate->check($file_check)) {
  171. return to_assign(1, $validate->getError());
  172. }
  173. //获取对应的上传配置
  174. $fs = \think\facade\Filesystem::disk('public');
  175. $ext = $file->extension();
  176. $chunkPath = $data['file_id'].'/'.$file->md5().($ext ? '.'.$ext : '');
  177. //存储分片文件到指定路径
  178. $savename = $fs->putFileAs( 'chunk', $file,$chunkPath);
  179. if (!$savename) {
  180. return json([
  181. 'code' => 1,
  182. 'msg' => '上传失败',
  183. 'data' => [],
  184. ]);
  185. }
  186. if (!$data['is_end']) {
  187. $filepath = '';
  188. } else {
  189. //合并块文件
  190. $fileUrl = '';
  191. $chunkSaveDir = \think\facade\Filesystem::getDiskConfig('public');
  192. $smallChunkDir = $chunkSaveDir['root'].'/chunk/'.$data['file_id'];
  193. //获取已存储的属于源文件的所有分块文件 进行合并
  194. if ($handle = opendir($smallChunkDir)) {
  195. $chunkList = [];
  196. $modifyTime = [];
  197. while (false !== ($file = readdir($handle))) {
  198. if ($file != "." && $file != "..") {
  199. $temp['path'] = $smallChunkDir.'/'.$file;
  200. $temp['modify'] = filemtime($smallChunkDir.'/'.$file);
  201. $chunkList[] = $temp;
  202. $modifyTime[] = $temp['modify'];
  203. }
  204. }
  205. //对分块文件进行排序
  206. array_multisort($modifyTime,SORT_ASC,$chunkList);
  207. $saveDir = \think\facade\Filesystem::getDiskConfig('public');
  208. $saveName = md5($data['file_id'].$data['file_name']).'.'.$data['file_extension'];
  209. $newPath = $saveDir['root'].'/'.date('Ym').'/'.$saveName;
  210. if (!file_exists($saveDir['root'].'/'.date('Ym'))) {
  211. mkdir($saveDir['root'].'/'.date('Ym'),0777,true);
  212. }
  213. $newFileHandle = fopen($newPath,'a+b');
  214. foreach ($chunkList as $item) {
  215. fwrite($newFileHandle,file_get_contents($item['path']));
  216. unlink($item['path']);
  217. }
  218. rmdir($smallChunkDir);
  219. //将合并后的文件存储到指定路径
  220. $fileUrl = $saveDir['url'].'/'.date('Ym').'/'.$saveName;
  221. fclose($newFileHandle);
  222. closedir($handle);
  223. } else {
  224. return json([
  225. 'code' => 1,
  226. 'msg' => '目录:'.$chunkSaveDir['root'].'/chunk/'.$data['file_id'].'不存在',
  227. 'data' => [],
  228. ]);
  229. }
  230. $filepath = $fileUrl;
  231. }
  232. $res=[];
  233. //合并流程结束
  234. if ($filepath!='') {
  235. $fileinfo = [];
  236. $fileinfo['filepath'] = $filepath;
  237. $fileinfo['name'] = $data['file_name'];
  238. $fileinfo['fileext'] = $data['file_extension'];
  239. $fileinfo['filesize'] = $data['file_size'];
  240. $fileinfo['filename'] = date('Ym').'/'.$saveName;
  241. $fileinfo['sha1'] = $data['file_id'];
  242. $fileinfo['md5'] = $data['file_id'];
  243. $fileinfo['module'] = \think\facade\App::initialize()->http->getName();
  244. $fileinfo['action'] = app('request')->action();
  245. $fileinfo['uploadip'] = app('request')->ip();
  246. $fileinfo['create_time'] = time();
  247. $fileinfo['user_id'] = get_login_admin('id') ? get_login_admin('id') : 0;
  248. if ($fileinfo['module'] = 'admin') {
  249. //通过后台上传的文件直接审核通过
  250. $fileinfo['status'] = 1;
  251. $fileinfo['admin_id'] = $fileinfo['user_id'];
  252. $fileinfo['audit_time'] = time();
  253. }
  254. $fileinfo['use'] = 'big';
  255. $res['id'] = Db::name('file')->insertGetId($fileinfo);
  256. $res['filepath'] = $fileinfo['filepath'];
  257. $res['name'] = $fileinfo['name'];
  258. $res['filename'] = $fileinfo['filename'];
  259. $res['filesize'] = $fileinfo['filesize'];
  260. $res['fileext'] = $fileinfo['fileext'];
  261. add_log('upload', $fileinfo['user_id'], $fileinfo);
  262. }
  263. return to_assign(0, '上传成功', $res);
  264. }
  265. }
  266. else{
  267. return to_assign(1, '非法请求', $res);
  268. }
  269. }
  270. //取消上传,删除临时文件
  271. public function clearChunk() {
  272. if ($this->request->isPost()) {
  273. $param = get_params();
  274. $saveDir = \think\facade\Filesystem::getDiskConfig('public');
  275. $smallChunkDir = $saveDir['root'].'/chunk/'.$param['file_id'];
  276. if(!is_dir($smallChunkDir)){
  277. return to_assign(0, '上传的临时文件已删除');
  278. }
  279. //获取已存储的属于源文件的所有分块文件
  280. if ($handle = opendir($smallChunkDir)) {
  281. while (false !== ($file = readdir($handle))) {
  282. if ($file != "." && $file != "..") {
  283. $temp['path'] = $smallChunkDir.'/'.$file;
  284. unlink($temp['path']);
  285. }
  286. }
  287. rmdir($smallChunkDir);
  288. closedir($handle);
  289. return to_assign(0, '已取消上传');
  290. }
  291. }
  292. }
  293. //附件重命名
  294. public function file_edit()
  295. {
  296. $param = get_params();
  297. if (Db::name('File')->where('id',$param['id'])->update(['name'=>$param['title']]) !== false) {
  298. add_log('edit', $param['id'], $param,'文件名称');
  299. return to_assign(0, "操作成功");
  300. } else {
  301. return to_assign(1, "操作失败");
  302. }
  303. }
  304. //获取编辑记录
  305. public function load_log()
  306. {
  307. $param = get_params();
  308. $log = new EditLog();
  309. $list = $log->datalist($param);
  310. $total = Db::name('EditLog')->where(['name'=>$param['name'],'action_id'=>$param['action_id']])->count();
  311. $totalRow['total'] = $total;
  312. return to_assign(0, '', $list,$totalRow);
  313. }
  314. //清空缓存
  315. public function cache_clear()
  316. {
  317. \think\facade\Cache::clear();
  318. return to_assign(0, '系统缓存已清空');
  319. }
  320. // 测试邮件发送
  321. public function email_test()
  322. {
  323. $sender = get_params('email');
  324. //检查是否邮箱格式
  325. if (!is_email($sender)) {
  326. return to_assign(1, '测试邮箱码格式有误');
  327. }
  328. $email_config = \think\facade\Db::name('config')->where('name', 'email')->find();
  329. $config = unserialize($email_config['content']);
  330. $content = $config['template'];
  331. //所有项目必须填写
  332. if (empty($config['smtp']) || empty($config['smtp_port']) || empty($config['smtp_user']) || empty($config['smtp_pwd'])) {
  333. return to_assign(1, '请完善邮件配置信息');
  334. }
  335. $send = send_email($sender, '测试邮件', $content);
  336. if ($send) {
  337. return to_assign(0, '邮件发送成功');
  338. } else {
  339. return to_assign(1, '邮件发送失败');
  340. }
  341. }
  342. //测试发送阿里云短信
  343. public function sms_test()
  344. {
  345. $phoneNumbers = '136xxxxxxxx';
  346. // $code = rand(1000, 9999); // 示例验证码
  347. $sms = new Smsservice();
  348. $result = $sms->sendSms($phoneNumbers, 'SMS_xxxxxx', ['name' => '勾股OA','title'=>'《测试阿里云短信发送成功》']);
  349. if ($result['code'] === 'OK') {
  350. return to_assign(0, '发送成功');
  351. } else {
  352. return to_assign(1, '发送失败:'.$result['message']);
  353. }
  354. }
  355. //获取未读消息
  356. public function get_msg()
  357. {
  358. $msg_map[] = ['to_uid', '=', $this->uid];
  359. $msg_map[] = ['read_time', '=', 0];
  360. $msg_map[] = ['delete_time', '=', 0];
  361. $msg_count = Db::name('Msg')->where($msg_map)->count();
  362. return to_assign(0, 'ok', $msg_count);
  363. }
  364. //获取部门
  365. public function get_department()
  366. {
  367. $department = get_department();
  368. return to_assign(0, '', $department);
  369. }
  370. //获取部门树形节点列表,用于tree前端组件
  371. public function get_department_tree()
  372. {
  373. $department = get_department();
  374. $list = get_tree($department);
  375. $data['trees'] = $list;
  376. return json($data);
  377. }
  378. //获取下属部门树形节点列表,用于tree前端组件
  379. public function get_department_tree_sub()
  380. {
  381. if($this->uid==1){
  382. $department = get_department();
  383. }
  384. else{
  385. $dids = get_leader_departments($this->uid);
  386. $department = Db::name('Department')->order('sort desc,id asc')->where([['status','=',1],['id','in',$dids]])->select()->toArray();
  387. }
  388. $list = get_tree($department,$department[0]['pid']);
  389. $data['trees'] = $list;
  390. return json($data);
  391. }
  392. //获取部门树形节点列表,用于X-select前端组件
  393. public function get_department_select()
  394. {
  395. $keyword = get_params('keyword');
  396. $selected = [];
  397. if(!empty($keyword)){
  398. $selected = explode(",",$keyword);
  399. }
  400. $department = get_department();
  401. $list = get_select_tree($department, 0,0,$selected);
  402. return to_assign(0, '',$list);
  403. }
  404. //获取所有员工,did>0时时获取部门员工,用于picker签单组件
  405. public function get_employee($did = 0)
  406. {
  407. $where=[];
  408. $whereOr=[];
  409. if (!empty($did)) {
  410. $admin_array = Db::name('DepartmentAdmin')->where('department_id',$did)->column('admin_id');
  411. $map1=[
  412. ['a.id','in',$admin_array],
  413. ];
  414. $map2=[
  415. ['a.did', '=', $did],
  416. ];
  417. $whereOr =[$map1,$map2];
  418. }
  419. $where[] = ['a.id', '>', 1];
  420. $where[] = ['a.status', '=', 1];
  421. $where[] = ['a.delete_time', '=', 0];
  422. $employee = Db::name('admin')
  423. ->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
  424. ->alias('a')
  425. ->join('Position p', 'p.id = a.position_id','left')
  426. ->join('Department d', 'a.did = d.id','left')
  427. ->where($where)
  428. ->where(function ($query) use($whereOr) {
  429. if (!empty($whereOr)){
  430. $query->whereOr($whereOr);
  431. }
  432. })
  433. ->group('a.id')
  434. ->order('a.id desc')
  435. ->select();
  436. return to_assign(0, '', $employee);
  437. }
  438. //获取所有下属员工,did>0时时获取部门员工,用于picker签单组件
  439. public function get_employee_sub($did = 0)
  440. {
  441. $where=[];
  442. $whereOr=[];
  443. if (!empty($did)) {
  444. $admin_array = Db::name('DepartmentAdmin')->where('department_id',$did)->column('admin_id');
  445. $map1=[
  446. ['a.id','in',$admin_array],
  447. ];
  448. $map2=[
  449. ['a.did', '=', $did],
  450. ];
  451. $whereOr =[$map1,$map2];
  452. }
  453. else{
  454. if($this->uid>1){
  455. $dids = get_leader_departments($this->uid);
  456. $where[] = ['a.did', 'in', $dids];
  457. }
  458. }
  459. $where[] = ['a.id', '>', 1];
  460. $where[] = ['a.status', '=', 1];
  461. $where[] = ['a.delete_time', '=', 0];
  462. $employee = Db::name('admin')
  463. ->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
  464. ->alias('a')
  465. ->join('Position p', 'p.id = a.position_id','left')
  466. ->join('Department d', 'a.did = d.id','left')
  467. ->where($where)
  468. ->where(function ($query) use($whereOr) {
  469. if (!empty($whereOr)){
  470. $query->whereOr($whereOr);
  471. }
  472. })
  473. ->group('a.id')
  474. ->order('a.id desc')
  475. ->select();
  476. return to_assign(0, '', $employee);
  477. }
  478. //获取所有员工
  479. public function get_personnel()
  480. {
  481. $param = get_params();
  482. $where[] = ['a.status', '=', 1];
  483. $where[] = ['a.id', '>', 1];
  484. $where[] = ['a.delete_time', '=', 0];
  485. if (!empty($param['keywords'])) {
  486. $where[] = ['a.name', 'like', '%' . $param['keywords'] . '%'];
  487. }
  488. if(!empty($param['ids'])){
  489. //排除某些员工
  490. $where[] = ['a.id', 'notin', $param['ids']];
  491. }
  492. $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
  493. $list = Db::name('admin')
  494. ->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
  495. ->alias('a')
  496. ->join('Department d', 'a.did = d.id')
  497. ->where($where)
  498. ->order('a.id desc')
  499. ->paginate(['list_rows'=> $rows]);
  500. return table_assign(0, '', $list);
  501. }
  502. //获取所有员工,用于X-select前端组件,did>0时时获取部门员工
  503. public function get_employee_select($did=0)
  504. {
  505. $keyword = get_params('keyword');
  506. $selected = [];
  507. if(!empty($keyword)){
  508. $selected = explode(",",$keyword);
  509. }
  510. if($did == 0){
  511. $employee = Db::name('admin')->field('id as value,name')->where(['status' => 1,'delete_time'=>0])->select()->toArray();
  512. }
  513. else{
  514. $employee = get_department_employee($did);
  515. }
  516. $list=[];
  517. foreach($employee as $k => $v){
  518. $select = '';
  519. if(in_array($v['id'],$selected)){
  520. $select = 'selected';
  521. }
  522. $list[]=[
  523. 'value'=>$v['id'],
  524. 'name'=>$v['name'],
  525. 'selected'=>$select
  526. ];
  527. }
  528. return to_assign(0, '', $list);
  529. }
  530. //获取某部门的负责人
  531. public function get_department_leader($uid=0,$pid=0)
  532. {
  533. $leaders = get_department_leader($uid,$pid);
  534. return to_assign(0, '', $leaders);
  535. }
  536. //获取职位
  537. public function get_position()
  538. {
  539. $position = Db::name('Position')->field('id,title')->where([['status', '=', 1], ['id', '>', 1]])->select();
  540. return to_assign(0, '', $position);
  541. }
  542. //获取消息模板
  543. public function get_template()
  544. {
  545. $param = get_params();
  546. if (!empty($param['keywords'])) {
  547. $where[] = ['title', 'like', '%' . $param['keywords'] . '%'];
  548. }
  549. $where[] = ['status', '=', 1];
  550. $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
  551. $list = Db::name('Template')->field('id,title')->where($where)->paginate(['list_rows'=> $rows]);;
  552. return table_assign(0, '', $list);
  553. }
  554. //读取报销类型
  555. function get_expense_cate()
  556. {
  557. $cate = get_base_data('ExpenseCate');
  558. return to_assign(0, '', $cate);
  559. }
  560. //读取费用类型
  561. function get_cost_cate()
  562. {
  563. $cate = get_base_data('CostCate');
  564. return to_assign(0, '', $cate);
  565. }
  566. //读取印章类型
  567. function get_seal_cate()
  568. {
  569. $cate = get_base_data('SealCate');
  570. return to_assign(0, '', $cate);
  571. }
  572. //读取车辆类型
  573. function get_car_cate()
  574. {
  575. $cate = get_base_data('CarCate');
  576. return to_assign(0, '', $cate);
  577. }
  578. //读取企业主体
  579. function get_subject()
  580. {
  581. $subject = get_base_data('Subject');
  582. return to_assign(0, '', $subject);
  583. }
  584. //读取行业类型
  585. function get_industry()
  586. {
  587. $industry = get_base_data('Industry');
  588. return to_assign(0, '', $industry);
  589. }
  590. //读取服务类型
  591. function get_services()
  592. {
  593. $services = get_base_data('Services');
  594. return to_assign(0, '', $services);
  595. }
  596. //获取工作类型列表
  597. public function get_work_cate()
  598. {
  599. $cate = get_base_data('WorkCate');
  600. return to_assign(0, '', $cate);
  601. }
  602. }