api_boniu_index_day5.php 1014 B

1
  1. <?php /** * Created by PhpStorm. * User: wanggagtao * Date: 2019/4/18 * Time: 10:47 AM */ try { $code = isset($_REQUEST['code'])?safeCheck($_REQUEST['code'],0):'0'; $start_date = isset($_REQUEST['start_date'])?safeCheck($_REQUEST['start_date'],0):'0';//2020/02/01转换为时间戳 $end_date = isset($_REQUEST['end_date'])?safeCheck($_REQUEST['end_date'],0):'0'; $index_type = isset($_REQUEST['index_type']); $start_date =(int)strtotime($start_date) ; $end_date =(int)strtotime($end_date) ; if(empty($code)) throw new MyException("code参数不能为空",101); if(empty($start_date)) throw new MyException("start_date参数不能为空",101); if(empty($end_date)) throw new MyException("end_date参数不能为空",101); $stock_info=Index_day_k::getIndexListHistroy($code,$start_date,$end_date,$index_type); echo action_msg_data(API::SUCCESS_MSG, API::SUCCESS, $stock_info); }catch (MyException $e){ $api->ApiError($e->getCode(), $e->getMessage()); }