|
- <?php
-
- /**
- *
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 娄梦宁
- * PhpStorm AroundService.php
- * Create By 2016/11/10 13:26 $
- */
- namespace Around\Service;
-
- use Around\Model\AroundModel;
- use Util\Util\Util;
-
- class AroundService
- {
- function getlist($area_id, $page, $limit)
- {
- $result = new AroundModel();
- $results = $result->getlists($area_id, $page, $limit);
- return $results;
- }
-
- function getdetaile($pro_id)
- {
- $result = new AroundModel();
- $results = $result->getdetailes($pro_id);
- return $results;
- }
-
- function getorder($pro_id, $date, $pnum)
- {
- $result = new AroundModel();
- $results = $result->getorders($pro_id, $date, $pnum);
- return $results;
- }
-
- function getdate($pro_id)
- {
- $result = new AroundModel();
- $results = $result->getdate($pro_id);
- return $results;
- }
-
- function makeOrder($arr)
- {
- $check=$this->checkParamsForMakeOrder($arr);
- if($check['flag']){
- $result = new AroundModel();
- $results = $result->makeorders($arr);
- return $results;
- }else{
- return $check;
- }
-
- }
-
- public function checkParamsForMakeOrder($arr)
- {
- if(Util::checkPattern('intVal', $arr['para_line_id']) == false) {
- $msg = '产品ID不合法';
- } elseif(Util::checkPattern('date', $arr['para_start_date']) == false){
- $msg = '非法日期';
- }elseif(Util::checkPattern('date', $arr['para_start_date']) == false){
- $msg = '非法日期';
- }else {
- return Util::returnArrSu();
- }
- return Util::returnArrEr($msg);
- }
- }
|