小程序用户改用门店登录

This commit is contained in:
liu
2026-08-20 13:46:04 +08:00
parent 6d9f02d831
commit c1d490134e
251 changed files with 689 additions and 2727 deletions
@@ -7,7 +7,6 @@ use App\Http\Requests\Customer\CustomerLevelFormRequest;
use App\Models\CustomerLevelModel;
use App\Models\NoticeModel;
use App\Models\StoreModel;
use App\Models\UserModel;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
@@ -114,18 +113,13 @@ class CustomerLevelController extends BaseController
}
/**
* 上浮比例变更后,给该等级下正常门店绑定的正常用户生成价格变更通知
* 上浮比例变更后,给该等级下全部正常门店生成价格变更通知
*/
private function notifyPriceChange(CustomerLevelModel $level): void
{
$userIds = UserModel::query()
->where('status', UserModel::STATUS_NORMAL)
->whereIn('store_id', function ($q) use ($level) {
$q->select('id')
->from('store')
->where('status', StoreModel::STATUS_NORMAL)
->where('level_id', $level->id);
})
$storeIds = StoreModel::query()
->where('status', StoreModel::STATUS_NORMAL)
->where('level_id', $level->id)
->pluck('id');
$content = mb_substr(
@@ -134,9 +128,9 @@ class CustomerLevelController extends BaseController
500
);
foreach ($userIds as $userId) {
foreach ($storeIds as $storeId) {
NoticeModel::create([
'user_id' => $userId,
'store_id' => $storeId,
'type' => NoticeModel::TYPE_PRICE,
'title' => '商品价格变更',
'content' => $content,