|
|
@ -4,7 +4,7 @@ namespace App\Admin\Repositories; |
|
|
use Dcat\Admin\Grid; |
|
|
use Dcat\Admin\Grid; |
|
|
use Dcat\Admin\Repositories\Repository; |
|
|
use Dcat\Admin\Repositories\Repository; |
|
|
use Illuminate\Pagination\LengthAwarePaginator; |
|
|
use Illuminate\Pagination\LengthAwarePaginator; |
|
|
use SimpleSSDB; |
|
|
|
|
|
|
|
|
use App\Libs\SsdbClient; |
|
|
|
|
|
|
|
|
class CouponTie extends Repository{ |
|
|
class CouponTie extends Repository{ |
|
|
|
|
|
|
|
|
@ -15,28 +15,18 @@ class CouponTie extends Repository{ |
|
|
|
|
|
|
|
|
public function get(Grid\Model $model) |
|
|
public function get(Grid\Model $model) |
|
|
{ |
|
|
{ |
|
|
$host = env('SSDB_HOST'); |
|
|
|
|
|
$port = env('SSDB_PORT'); |
|
|
|
|
|
try{ |
|
|
|
|
|
$ssdb = new SimpleSSDB($host, $port); |
|
|
|
|
|
$ssdb->auth(env('SSDB_AUTH')); |
|
|
|
|
|
}catch(\Exception $e){ |
|
|
|
|
|
dd($e); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$activity = $ssdb->get('coupon_rebate_activity'); |
|
|
|
|
|
$forward = $ssdb->hgetall('coupon_rebate_forward_'.$activity); |
|
|
|
|
|
$forward = is_array($forward) ? implode(' , ',$forward) : $forward ; |
|
|
|
|
|
$repay = $ssdb->get('coupon_rebate_repay_'.$activity); |
|
|
|
|
|
|
|
|
$ssdb = new SsdbClient(); |
|
|
|
|
|
$coupon = $ssdb->client()->hgetall('coupon_rebate_activity'); |
|
|
|
|
|
|
|
|
return $model->makePaginator( |
|
|
return $model->makePaginator( |
|
|
1, |
|
|
1, |
|
|
[ |
|
|
[ |
|
|
[ |
|
|
[ |
|
|
'id'=>1, |
|
|
'id'=>1, |
|
|
'activity'=>$activity, |
|
|
|
|
|
'forward'=>$forward, |
|
|
|
|
|
'repay' => $repay |
|
|
|
|
|
|
|
|
'activity'=>$coupon['activity'], |
|
|
|
|
|
'forward'=>$coupon['forward'], |
|
|
|
|
|
'repay' => $coupon['repay'] |
|
|
], |
|
|
], |
|
|
], |
|
|
], |
|
|
); |
|
|
); |
|
|
|