Commit 8883939f by 庄欣

促销的修改

parent 14aa8e1e
...@@ -22,16 +22,7 @@ class SetsEditedListener ...@@ -22,16 +22,7 @@ class SetsEditedListener
/** /**
*修改促销信息等等 *修改促销信息等等
*/ */
$searcher = Search::getSearcher(); return true;
if($model->is_del == 0 && $model->is_shelf == $model::SHELF_UP && $model->exists == true) {
//修改而非新增
if ($model->wasRecentlyCreated == false) {
if ($model->is_promotion == 1)
{
}
}
}
} }
} }
\ No newline at end of file
...@@ -116,42 +116,42 @@ class SetsValidator extends Validator ...@@ -116,42 +116,42 @@ class SetsValidator extends Validator
return $messages; return $messages;
} }
if ($data["is_promotion"] == 1 && empty($data['promotion']['id'])) { if ($data["is_promotion"] == 1 && empty($data['promotion'])) {
if ($data['promotion']['promotion_start_time'] >= $data['promotion']['promotion_end_time']) { if ($data['promotion'][0]['promotion_start_time'] >= $data['promotion'][0]['promotion_end_time']) {
$messages[] = "特惠开始时间应小于特惠停止时间"; $messages[] = "特惠开始时间应小于特惠停止时间";
return $messages; return $messages;
} }
if ((int)$data['promotion']['per_user_count'] > $data['promotion']['p_order_count']) { if ((int)$data['promotion'][0]['per_user_count'] > $data['promotion'][0]['p_order_count']) {
$messages[] = "特惠的限购额度应小于特惠数量"; $messages[] = "特惠的限购额度应小于特惠数量";
return $messages; return $messages;
} }
if ($data['promotion']['p_order_count'] <= 0 ) { if ($data['promotion'][0]['p_order_count'] <= 0 ) {
$messages[] = "特惠数量应大于0"; $messages[] = "特惠数量应大于0";
return $messages; return $messages;
} }
if ($data['promotion']['promotion_start_time'] < $data['start_time']) { if ($data['promotion'][0]['promotion_start_time'] < $data['start_time']) {
$messages[] = "特惠的开始时间应大于套系的起始有效时间"; $messages[] = "特惠的开始时间应大于套系的起始有效时间";
return $messages; return $messages;
} }
if ($data['promotion']['promotion_end_time'] > $data['end_time']) { if ($data['promotion'][0]['promotion_end_time'] > $data['end_time']) {
$messages[] = "特惠的结束时间应小于在套系终止有效时间"; $messages[] = "特惠的结束时间应小于在套系终止有效时间";
return $messages; return $messages;
} }
$startdate=strtotime($data['promotion']['promotion_start_time']); $startdate=strtotime($data['promotion'][0]['promotion_start_time']);
$enddate=strtotime($data['promotion']['promotion_end_time']); $enddate=strtotime($data['promotion'][0]['promotion_end_time']);
$days=round(($enddate-$startdate)/3600/24) ; $days=round(($enddate-$startdate)/3600/24) ;
if ($days > 100) { if ($days > 100) {
$messages[] = "特惠时间长度不应大于100天"; $messages[] = "特惠时间长度不应大于100天";
return $messages; return $messages;
} }
if ($data['promotion']['promotion_price'] >= $data['price']) { if ($data['promotion'][0]['promotion_price'] >= $data['price']) {
$messages[] = "特惠价格应小于套系价格"; $messages[] = "特惠价格应小于套系价格";
return $messages; return $messages;
} }
if ($data['promotion']['promotion_price'] < 5) { if ($data['promotion'][0]['promotion_price'] < 5) {
$messages[] = "特惠价格应大于5元"; $messages[] = "特惠价格应大于5元";
return $messages; return $messages;
} }
......
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