RiceCardOrderRemark.php 798 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\common\model\card;
  3. use app\common\model\BaseModel;
  4. use app\common\model\store\User as UserStore;
  5. /**
  6. * 米卡订单备注模型
  7. * @package app\common\model
  8. */
  9. class RiceCardOrderRemark extends BaseModel
  10. {
  11. protected $name = 'rice_card_order_remark';
  12. protected $append = [
  13. 'admin_name'
  14. ];
  15. public function getAdminNameAttr($value)
  16. {
  17. $admin = UserStore::where('store_user_id', $this->admin_id)->find();
  18. if ($admin) {
  19. return $admin->user_name ?? '';
  20. }
  21. return '';
  22. }
  23. /**
  24. * 获取记录
  25. * @param int $id
  26. * @param array $with
  27. * @return static
  28. */
  29. public static function detail(int $id, array $with = [])
  30. {
  31. return static::get($id, $with);
  32. }
  33. }