Order.php 562 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace addons\YunfastPay\common\models;
  3. use common\models\order\Order as OrderModel;
  4. /**
  5. * Mall Order
  6. * @package addons\YunfastPay\common\models
  7. */
  8. class Order extends OrderModel
  9. {
  10. /**
  11. * id获取订单号
  12. *
  13. * @param integer $id
  14. * @return string|int|null|false the value of the first column in the first row of the query result.
  15. */
  16. public static function getOrderNoById(int $id)
  17. {
  18. return static::find()
  19. ->where(['id' => $id])
  20. ->select('order_no')
  21. ->scalar();
  22. }
  23. }