StoreCouponIssueUser.php 820 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @author: xaboy<365615158@qq.com>
  4. * @day: 2018/01/23
  5. */
  6. namespace app\admin\model\ump;
  7. use crmeb\basic\BaseModel;
  8. use crmeb\traits\ModelTrait;
  9. class StoreCouponIssueUser extends BaseModel
  10. {
  11. /**
  12. * 模型名称
  13. * @var string
  14. */
  15. protected $name = 'store_coupon_issue_user';
  16. use ModelTrait;
  17. public static function systemCouponIssuePage($issue_coupon_id)
  18. {
  19. $model = self::alias('A')->field('B.nickname,B.avatar,A.add_time')
  20. ->join('user B', 'A.uid = B.uid')
  21. ->where('A.issue_coupon_id', $issue_coupon_id);
  22. return self::page($model, function ($item) {
  23. $item['add_time'] = $item['add_time'] == 0 ? '未知' : date('Y/m/d H:i', $item['add_time']);
  24. return $item;
  25. }, ['id' => $issue_coupon_id]);
  26. }
  27. }