openxiangAction.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * 外部调用单据详情页
  4. */
  5. class openxiangClassAction extends openapiAction
  6. {
  7. public function initAction()
  8. {
  9. $this->showreturn('', '此页面弃用', 201);//2025-04-09
  10. }
  11. /**
  12. * 详情
  13. */
  14. public function dataAction()
  15. {
  16. $list['hetong'] = 'custract,customer'; //配置可读取模块
  17. $num = $this->get('num');
  18. $xcytype = $this->get('xcytype');
  19. $mid = (int)$this->get('mid','0');
  20. if(isempt($num) || !$xcytype || $mid==0)return returnerror('num isempt');
  21. $kears = arrvalue($list, $xcytype);
  22. if(!$kears)return returnerror('无效模块1');
  23. if(!in_array($num,explode(',', $kears)))return returnerror('无效模块2');
  24. $flow = m('flow')->initflow($num,$mid, false);
  25. $barr['modename'] = $flow->modename;
  26. $barr['btndata'] = array();
  27. $barr['xiangdata']= array();
  28. if(method_exists($flow,'openxiang')){
  29. $lbarr = $flow->openxiang();
  30. if(is_array($lbarr))foreach($lbarr as $k=>$v)$barr[$k]=$v;
  31. }
  32. return returnsuccess($barr);
  33. }
  34. /**
  35. * 操作菜单
  36. */
  37. public function optmenuAction()
  38. {
  39. $num = $this->get('num');
  40. $xcytype = $this->get('xcytype');
  41. $mid = (int)$this->get('mid','0');
  42. $menuid = (int)$this->get('menuid','0');
  43. $sm = c('check')->onlysql($this->jm->base64decode($this->get('sm')));
  44. if(isempt($num) || !$xcytype || $mid==0)return returnerror('num isempt');
  45. $flow = m('flow')->initflow($num,$mid, false);
  46. $msg = $flow->optmenu($menuid,1,$sm);
  47. if($msg!='ok')return returnerror($msg);
  48. return returnsuccess($msg);
  49. }
  50. /**
  51. * 下载文件
  52. */
  53. public function downurlAction()
  54. {
  55. $id = (int)$this->get('id','0');
  56. $openid = $this->get('openid');
  57. if(isempt($openid))return;
  58. if(m('wxxcyus')->rows("`openid`='$openid'")==0)return;
  59. m('file')->show($id, true);
  60. }
  61. /**
  62. * 返回文件详情
  63. */
  64. public function fileinfoAction()
  65. {
  66. $id = (int)$this->get('id','0');
  67. $openid = $this->get('openid');
  68. if(isempt($openid))return returnerror('无效openid1');
  69. if(m('wxxcyus')->rows("`openid`='$openid'")==0)return returnerror('无效openid');
  70. $frs = m('file')->getone($id,'id,filename,filesize,fileext,filepath,filepathout');
  71. return returnsuccess($frs);
  72. }
  73. }
粤ICP备19079148号