链街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.

50 lines
1.2 KiB

  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. $data = [
  25. [
  26. 'id'=>1,
  27. 'activity'=>$coupon['activity'],
  28. 'forward'=>$coupon['forward'],
  29. 'repay' => $coupon['repay']
  30. ]
  31. ];
  32. return $data;
  33. // return $model->makePaginator(
  34. // 1,
  35. // [
  36. // [
  37. // 'id'=>1,
  38. // 'activity'=>$coupon['activity'],
  39. // 'forward'=>$coupon['forward'],
  40. // 'repay' => $coupon['repay']
  41. // ],
  42. // ]
  43. // );
  44. }
  45. }