1
0

openxiangAction.php 2.1 KB

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