链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
934 B

  1. <?php
  2. namespace App\Admin\Repositories;
  3. use Dcat\Admin\Grid;
  4. use Dcat\Admin\Repositories\Repository;
  5. use Illuminate\Pagination\LengthAwarePaginator;
  6. use App\Libs\SsdbClient;
  7. class CouponTie extends Repository
  8. {
  9. public function getPrimaryKeyColumn()
  10. {
  11. return '_id';
  12. }
  13. public function get(Grid\Model $model)
  14. {
  15. $ssdb = new SsdbClient();
  16. $coupon = $ssdb->client()->hgetall('coupon_rebate_activity');
  17. if(empty($coupon)){
  18. $coupon = [
  19. 'activity'=> 0,
  20. 'forward'=> '',
  21. 'repay' => ''
  22. ];
  23. }
  24. return $model->makePaginator(
  25. 1,
  26. [
  27. [
  28. 'id'=>1,
  29. 'activity'=>$coupon['activity'],
  30. 'forward'=>$coupon['forward'],
  31. 'repay' => $coupon['repay']
  32. ],
  33. ]
  34. );
  35. }
  36. }