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

42 lines
934 B

<?php
namespace App\Admin\Repositories;
use Dcat\Admin\Grid;
use Dcat\Admin\Repositories\Repository;
use Illuminate\Pagination\LengthAwarePaginator;
use App\Libs\SsdbClient;
class CouponTie extends Repository
{
public function getPrimaryKeyColumn()
{
return '_id';
}
public function get(Grid\Model $model)
{
$ssdb = new SsdbClient();
$coupon = $ssdb->client()->hgetall('coupon_rebate_activity');
if(empty($coupon)){
$coupon = [
'activity'=> 0,
'forward'=> '',
'repay' => ''
];
}
return $model->makePaginator(
1,
[
[
'id'=>1,
'activity'=>$coupon['activity'],
'forward'=>$coupon['forward'],
'repay' => $coupon['repay']
],
]
);
}
}