You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

77 lines
2.1 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 娄梦宁
  12. * PhpStorm AroundService.php
  13. * Create By 2016/11/10 13:26 $
  14. */
  15. namespace Around\Service;
  16. use Around\Model\AroundModel;
  17. use Util\Util\Util;
  18. class AroundService
  19. {
  20. function getlist($area_id, $page, $limit)
  21. {
  22. $result = new AroundModel();
  23. $results = $result->getlists($area_id, $page, $limit);
  24. return $results;
  25. }
  26. function getdetaile($pro_id)
  27. {
  28. $result = new AroundModel();
  29. $results = $result->getdetailes($pro_id);
  30. return $results;
  31. }
  32. function getorder($pro_id, $date, $pnum)
  33. {
  34. $result = new AroundModel();
  35. $results = $result->getorders($pro_id, $date, $pnum);
  36. return $results;
  37. }
  38. function getdate($pro_id)
  39. {
  40. $result = new AroundModel();
  41. $results = $result->getdate($pro_id);
  42. return $results;
  43. }
  44. function makeOrder($arr)
  45. {
  46. $check=$this->checkParamsForMakeOrder($arr);
  47. if($check['flag']){
  48. $result = new AroundModel();
  49. $results = $result->makeorders($arr);
  50. return $results;
  51. }else{
  52. return $check;
  53. }
  54. }
  55. public function checkParamsForMakeOrder($arr)
  56. {
  57. if(Util::checkPattern('intVal', $arr['para_line_id']) == false) {
  58. $msg = '产品ID不合法';
  59. } elseif(Util::checkPattern('date', $arr['para_start_date']) == false){
  60. $msg = '非法日期';
  61. }elseif(Util::checkPattern('date', $arr['para_start_date']) == false){
  62. $msg = '非法日期';
  63. }else {
  64. return Util::returnArrSu();
  65. }
  66. return Util::returnArrEr($msg);
  67. }
  68. }