OrderPaymentModel.php 733 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\model;
  3. class OrderPaymentModel extends BaseModel
  4. {
  5. protected $table = 'erp_order_payment';
  6. public function paymentChannel() {
  7. return $this->hasOne(PaymentChannelModel::class,'id', 'channel_id');
  8. }
  9. public function cardConfig() {
  10. return $this->hasOne(CreditCardConfigModel::class,'id', 'channel_credit_card_config_id');
  11. }
  12. protected function genSchema(array $schema)
  13. {
  14. // TODO: Implement genSchema() method.
  15. }
  16. public function findByOrderId($o_id) {
  17. return $this->where([
  18. ['order_id', '=', $o_id],
  19. ['is_delete', '=', 0],
  20. ['channel_id', '=', 11],
  21. ])->order('id', 'desc')->find();
  22. }
  23. }