mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-10 18:02:55 +00:00
no message
This commit is contained in:
parent
8e90ad69b1
commit
8a7e5c0830
@ -1202,27 +1202,32 @@ class UsersController extends AbstractController
|
||||
}
|
||||
//
|
||||
$user = User::auth();
|
||||
$version = $data['appVersion'] ? ($data['appVersionName'] . " ({$data['appVersion']})") : '';
|
||||
$isNotified = trim($data['isNotified']) === 'true' || $data['isNotified'] === true ? 1 : intval($data['isNotified']);
|
||||
$inArray = [
|
||||
'userid' => $user->userid,
|
||||
'alias' => $data['alias'],
|
||||
'platform' => Base::platform(),
|
||||
];
|
||||
$upArray = [
|
||||
$version = $data['appVersion'] ? ($data['appVersionName'] . " ({$data['appVersion']})") : '';
|
||||
$isNotified = trim($data['isNotified']) === 'true' || $data['isNotified'] === true ? 1 : intval($data['isNotified']);
|
||||
$row = UmengAlias::where($inArray);
|
||||
if ($row->exists()) {
|
||||
$row->update([
|
||||
'ua' => $data['userAgent'],
|
||||
'device' => $data['deviceModel'],
|
||||
'device_hash' => UserDevice::check(),
|
||||
'version' => $version,
|
||||
'is_notified' => $isNotified,
|
||||
'updated_at' => Carbon::now()
|
||||
]);
|
||||
return Base::retSuccess('别名已存在');
|
||||
}
|
||||
$row = UmengAlias::createInstance(array_merge($inArray, [
|
||||
'ua' => $data['userAgent'],
|
||||
'device' => $data['deviceModel'],
|
||||
'device_hash' => UserDevice::check(),
|
||||
'version' => $version,
|
||||
'is_notified' => $isNotified,
|
||||
];
|
||||
$row = UmengAlias::where($inArray);
|
||||
if ($row->exists()) {
|
||||
$upArray['updated_at'] = Carbon::now();
|
||||
$row->update($upArray);
|
||||
return Base::retSuccess('别名已存在');
|
||||
}
|
||||
$row = UmengAlias::createInstance(array_merge($inArray, $upArray));
|
||||
]));
|
||||
if ($row->save()) {
|
||||
return Base::retSuccess('添加成功');
|
||||
} else {
|
||||
|
||||
@ -16,7 +16,6 @@ use Hedeqiang\UMeng\IOS;
|
||||
* @property string|null $platform 平台类型
|
||||
* @property string|null $device 设备类型
|
||||
* @property string|null $device_hash 设备哈希值,用于关联UserDevice表
|
||||
* @property string|null $user_lang 用户语言
|
||||
* @property string|null $version 应用版本号
|
||||
* @property string|null $ua userAgent
|
||||
* @property int|null $is_notified 通知权限
|
||||
@ -40,7 +39,6 @@ use Hedeqiang\UMeng\IOS;
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UmengAlias wherePlatform($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UmengAlias whereUa($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UmengAlias whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UmengAlias whereUserLang($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UmengAlias whereUserid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|UmengAlias whereVersion($value)
|
||||
* @mixin \Eloquent
|
||||
|
||||
@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDeviceHashAndUserLangToUmengAliasTable extends Migration
|
||||
class AddDeviceHashToUmengAliasTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@ -16,7 +16,6 @@ class AddDeviceHashAndUserLangToUmengAliasTable extends Migration
|
||||
Schema::table('umeng_alias', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('umeng_alias', 'device_hash')) {
|
||||
$table->string('device_hash')->index()->nullable()->after('device')->comment('设备哈希值,用于关联UserDevice表');
|
||||
$table->string('user_lang', 10)->nullable()->after('device_hash')->comment('用户语言');
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -29,7 +28,7 @@ class AddDeviceHashAndUserLangToUmengAliasTable extends Migration
|
||||
public function down()
|
||||
{
|
||||
Schema::table('umeng_alias', function (Blueprint $table) {
|
||||
$table->dropColumn(['device_hash', 'user_lang']);
|
||||
$table->dropColumn('device_hash');
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1 +1 @@
|
||||
Subproject commit 674b3ed99119bd02d2af3a2265bb7beab70ae2f0
|
||||
Subproject commit a1745375245f66d9681d2c7ba8a1da413f351469
|
||||
Loading…
x
Reference in New Issue
Block a user