belongsTo(Orders::class,'order_id'); } public function user(){ return $this->belongsTo(User::class); } public function makeAudit($pass){ $this['status']=$pass; if($pass){ $order=$this->orders; if($order->is_wait_pay){ $order->makePay(); } } SiteMsg::sendMsg( $pass?SiteMsg::TYPE_ORDER_OFFLINE_PAY_PASS:SiteMsg::TYPE_ORDER_OFFLINE_PAY_REJECT, $this->user ); $this->save(); } }