分销等级配置商品券

main
ztt 8 months ago
parent f83af8fa1d
commit dc1305e5bd
  1. 13
      addons/shopro/controller/Coupon.php

@ -2,9 +2,12 @@
namespace addons\shopro\controller; namespace addons\shopro\controller;
use addons\shopro\service\commission\Agent;
use app\admin\model\shopro\commission\Level;
use app\admin\model\shopro\Coupon as CouponModel; use app\admin\model\shopro\Coupon as CouponModel;
use addons\shopro\traits\CouponSend; use addons\shopro\traits\CouponSend;
use app\admin\model\shopro\goods\Goods as GoodsModel; use app\admin\model\shopro\goods\Goods as GoodsModel;
use app\common\model\User;
class Coupon extends Common class Coupon extends Common
{ {
@ -100,4 +103,14 @@ class Coupon extends Common
$this->success('优惠券详情', $coupon); $this->success('优惠券详情', $coupon);
} }
/**
* 用户分销等级优惠券
*/
public function commissionCouponList() {
$user = auth_user();
$userInfo = (new \app\admin\model\shopro\commission\Agent())->where('user_id', $user->id)->find();
$data = Level::get(['level' => $userInfo['level']]);
$this->success($data['coupon_rules']);
}
} }

Loading…
Cancel
Save