|
@@ -5,6 +5,7 @@ namespace App\Modules\User\Services;
|
|
|
|
|
|
use App\Consts\SysConsts;
|
|
|
use App\Modules\BaseService;
|
|
|
+use App\Modules\User\Models\QappPackage;
|
|
|
use App\Modules\User\Models\QappUser;
|
|
|
use App\Modules\User\Models\User;
|
|
|
use DB;
|
|
@@ -140,6 +141,16 @@ class QappUserService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private function findChannelId(string $package)
|
|
|
+ {
|
|
|
+ $channel_id = env('QUICKAPP_SITE');
|
|
|
+ if ($package) {
|
|
|
+ $package_info = QappPackage::where('package', $package)->first();
|
|
|
+ $channel_id = $package_info ? $package_info->channel_id : $channel_id;
|
|
|
+ }
|
|
|
+ return $channel_id;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创建用户
|
|
|
*/
|
|
@@ -148,7 +159,7 @@ class QappUserService
|
|
|
$openid = $data['device_no'];
|
|
|
$unionid = $data['device_no'];
|
|
|
$register_ip = _getIp();
|
|
|
- $distribution_channel_id = env('QUICKAPP_SITE');
|
|
|
+ $distribution_channel_id = $this->findChannelId($data['package']);
|
|
|
$send_order_id = $data['send_order_id'];
|
|
|
$unique_key = compact('unionid', 'distribution_channel_id');
|
|
|
$data = compact('openid', 'register_ip', 'send_order_id');
|