Commit 5b8a080c authored by zhuwei's avatar zhuwei

1

parent 4b48ffb2
...@@ -264,3 +264,17 @@ function curl_post($url, array $params = array(), $timeout) ...@@ -264,3 +264,17 @@ function curl_post($url, array $params = array(), $timeout)
curl_close($ch); curl_close($ch);
return ($data); return ($data);
} }
/**
* 判断输入的字符串是否是合法日期
* @param $data
* @return bool
*/
function checkDate($data){
$date=strtotime($data);
if($data==(date("Y-m-d", $date))|| $data==(date("Y-m-j", $date))||$data==(date("Y-n-d", $date))||$data==(date("Y-n-j", $date)))
return true;//合法
else
return false;//非法
}
\ No newline at end of file
...@@ -450,11 +450,10 @@ class CostDetail extends Basic ...@@ -450,11 +450,10 @@ class CostDetail extends Basic
//计入月份 //计入月份
$conditions["b.setting_date"] = $params["setting_date"]; $conditions["b.setting_date"] = $params["setting_date"];
//门店id //门店id
$conditions["b.store_id"] = $params["store_id"]; $conditions["a.store_id"] = $params["store_id"];
$field = 'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name, $field = 'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name,
a.type,a.fee_item,a.purpose,c.store_id,a.assume_fee'; a.type,a.fee_item,a.purpose,b.store_id,a.assume_fee';
$list = $this->storeCostExt->getMyCostDetailList($field, $conditions); $list = $this->storeCostExt->getMyCostDetailList($field, $conditions);
if(!$list) if(!$list)
......
...@@ -57,6 +57,10 @@ class CostParameter extends Basic ...@@ -57,6 +57,10 @@ class CostParameter extends Basic
return $this->response("101", $checkResult); return $this->response("101", $checkResult);
} }
if(!checkDate($params['setting_date'])){
return $this->response("101", '非法时间');
}
$conditions = []; $conditions = [];
//门店 //门店
if (!empty($params['store_id'])) { if (!empty($params['store_id'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment