OrderVoucher.php 510 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * @property Orders orders
  6. */
  7. class OrderVoucher extends Model
  8. {
  9. protected $autoWriteTimestamp=true;
  10. public function orders(){
  11. return $this->belongsTo(Orders::class,'order_id');
  12. }
  13. public function makeAudit($pass){
  14. $this['status']=$pass;
  15. if($pass){
  16. $order=$this->orders;
  17. if($order->is_wait_pay){
  18. $order->makePay();
  19. }
  20. }
  21. $this->save();
  22. }
  23. }