仅分销员能生成二维码
This commit is contained in:
parent
38fb60b8b1
commit
a2529f0601
@ -927,7 +927,7 @@ class UserRepository extends BaseRepository
|
||||
*/
|
||||
public function bindSpread(User $user, int $spreadUid)
|
||||
{
|
||||
if ($spreadUid && !$user->spread_uid && $user->uid != $spreadUid && ($spread = $this->dao->get($spreadUid)) && $spread->spread_uid != $user->uid && !$spread->cancel_time) {
|
||||
if ($spreadUid && !$user->spread_uid && $user->uid != $spreadUid && ($spread = $this->dao->get($spreadUid)) && $spread->spread_uid != $user->uid && !$spread->cancel_time && $spread->is_promoter == 1) {
|
||||
$config = systemConfig(['extension_limit', 'extension_limit_day', 'integral_user_give']);
|
||||
event('user.spread.before', compact('user','spreadUid'));
|
||||
Db::transaction(function () use ($spread, $spreadUid, $user, $config) {
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
namespace app\controller\api\server;
|
||||
|
||||
use app\common\model\store\consumption\StoreConsumptionUser;
|
||||
use app\common\model\system\merchant\FinancialRecord;
|
||||
use app\common\model\system\merchant\Merchant;
|
||||
use app\controller\api\Common;
|
||||
use crmeb\basic\BaseController;
|
||||
use think\App;
|
||||
@ -63,4 +65,15 @@ class Store extends BaseController
|
||||
return app('json')->success(['count' => $count, 'list' => $list]);
|
||||
}
|
||||
|
||||
public function subsidy()
|
||||
{
|
||||
$type = $this->request->get('type', 1);
|
||||
$saleAmount = Merchant::where('mer_id', $this->merId)->value('sale_amount');
|
||||
if ($type == 1) {
|
||||
$purchaseAmount = StoreConsumptionUser::where('uid')
|
||||
->where('')
|
||||
->column('coupon_price,balance');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -545,6 +545,9 @@ class User extends BaseController
|
||||
* 生成二维码
|
||||
*/
|
||||
public function qrcode(){
|
||||
if ($this->user->is_promoter != 1) {
|
||||
return app('json')->fail('您不是推广员');
|
||||
}
|
||||
$common= app()->make(Common::class);
|
||||
$siteUrl = systemConfig('site_url');
|
||||
$data=$common->Qrcode(['code'=>$siteUrl.'download/index.html?code=shop_'.$this->user->uid,'id'=>$this->user->uid]);
|
||||
|
@ -4,7 +4,6 @@ namespace crmeb\listens;
|
||||
|
||||
use app\common\model\store\consumption\StoreConsumption;
|
||||
use app\common\model\store\consumption\StoreConsumptionUser;
|
||||
use app\common\model\store\order\StoreOrder;
|
||||
use app\common\model\system\merchant\Merchant;
|
||||
use app\common\model\user\UserBill;
|
||||
use crmeb\interfaces\ListenerInterface;
|
||||
@ -29,12 +28,8 @@ class ActivateConsumptionListen extends TimerService implements ListenerInterfac
|
||||
->where('status', StoreConsumptionUser::STATUS_REPEAL)
|
||||
->select();
|
||||
foreach ($storeConsumptionUser as $item) {
|
||||
$isUsed = StoreConsumptionUser::where('order_id_set', $item['order_id_set'])
|
||||
->where('balance', 0)
|
||||
->count();
|
||||
$merchantId = Merchant::where('uid', $item['uid'])->value('mer_id');
|
||||
$saleTotal = StoreOrder::where('mer_id', $merchantId)->whereIn('status', [2, 3])->sum('pay_price');
|
||||
if ($saleTotal >= $item['order_amount'] && $isUsed > 0) {
|
||||
$saleTotal = Merchant::where('uid', $item['uid'])->value('sale_amount');
|
||||
if ($saleTotal >= $item['order_amount'] && $item['balance'] <= 0) {
|
||||
$item->status = StoreConsumptionUser::STATUS_UNUSED;
|
||||
$item->start_time = date('Y-m-d H:i:s');
|
||||
$item->end_time = date('Y-m-d H:i:s', strtotime('+1 year'));
|
||||
|
@ -345,6 +345,7 @@ Route::group('api/', function () {
|
||||
Route::post('attr/delete', 'StoreProductAttrTemplate/batchDelete');
|
||||
Route::get('attr/detail/:id', 'StoreProductAttrTemplate/detail');
|
||||
Route::get('attr/list', 'StoreProductAttrTemplate/getlist');
|
||||
Route::get('subsidy', 'Store/subsidy');
|
||||
})->prefix('api.server.')->middleware(\app\common\middleware\MerchantServerMiddleware::class, 1);
|
||||
|
||||
//管理员订单
|
||||
|
Loading…
x
Reference in New Issue
Block a user