|
@@ -16,7 +16,7 @@ class Payment extends Model
|
|
|
'params'=>'json',
|
|
|
];
|
|
|
|
|
|
- public static function pay(User $user,$pay_type,$amount,$class,$func,$payment_id,$body="订单付款",$payment_type='order'){
|
|
|
+ public static function pay(User $user,$pay_type,$amount,$class,$func,$payment_id,$body="订单付款",$payment_type=''){
|
|
|
$payment=self::create([
|
|
|
'pay_type'=>$pay_type,
|
|
|
'class'=>$class,
|
|
@@ -40,5 +40,10 @@ class Payment extends Model
|
|
|
public function payed(){
|
|
|
$this['pay_time']=time();
|
|
|
$this->save();
|
|
|
+ switch ($this['payment_type']){
|
|
|
+ case 'orders':
|
|
|
+ Orders::makePayed($this['payment_id']);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|