@@ -132,7 +132,7 @@ class WholeController
if($time_id==0) return app('json')->fail('时间段不能为空');
if($price==0) return app('json')->fail('价格不能为0');
if($to_uid==0) $first_price = $price;
- if($last_id>0 && !Package::be(['id'=>$last_id,'uid'=>$to_uid])) return app('json')->fail('非法数据');
+
$rs = Package::reserve($request->uid(),$whole_id,$time_id,$to_uid,$price,$first_price,$last_id);
if($rs)
{
@@ -39,7 +39,7 @@ class Package extends BaseModel
if($last_id>0 && self::where('last_id',$last_id)->where('uid',$uid)->find())
return self::setErrorInfo('你已报名,无需重复报名');
- }elseif($last_id>0 && self::where('last_id',$last_id)->find())
+ }elseif($last_id>0 && self::where('last_id',$last_id)->where('status','>',-1)->find())
return self::setErrorInfo('该订单已有预约');
}