mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
perf: 优化数据结构
This commit is contained in:
parent
0be6c70e92
commit
6e68f399b4
@ -1101,10 +1101,17 @@ class UsersController extends AbstractController
|
||||
];
|
||||
$row = UmengAlias::where($inArray);
|
||||
if ($row->exists()) {
|
||||
$row->update(['updated_at' => Carbon::now()]);
|
||||
$row->update([
|
||||
'ua' => $data['userAgent'],
|
||||
'device' => $data['deviceModel'],
|
||||
'updated_at' => Carbon::now()
|
||||
]);
|
||||
return Base::retSuccess('别名已存在');
|
||||
}
|
||||
$row = UmengAlias::createInstance($inArray);
|
||||
$row = UmengAlias::createInstance(array_merge($inArray, [
|
||||
'ua' => $data['userAgent'],
|
||||
'device' => $data['deviceModel'],
|
||||
]));
|
||||
if ($row->save()) {
|
||||
return Base::retSuccess('添加成功');
|
||||
} else {
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddUmengAliasDevice extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
Schema::table('umeng_alias', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('umeng_alias', 'device')) {
|
||||
$table->text('ua')->nullable()->after('platform')->comment('userAgent');
|
||||
$table->string('device', 100)->nullable()->default('')->after('platform')->comment('设备类型');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
Schema::table('umeng_alias', function (Blueprint $table) {
|
||||
$table->dropColumn("ua");
|
||||
$table->dropColumn("device");
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -101,13 +101,15 @@ export default {
|
||||
//
|
||||
if (this.userId > 0 && this.$isEEUiApp) {
|
||||
$A.eeuiAppSendMessage({
|
||||
action: 'intiUmeng',
|
||||
action: 'initApp',
|
||||
apiUrl: $A.apiUrl(''),
|
||||
userid: this.userId,
|
||||
token: this.userToken,
|
||||
userAgent: window.navigator.userAgent,
|
||||
});
|
||||
setTimeout(_ => {
|
||||
$A.eeuiAppSendMessage({
|
||||
action: 'setUmengAlias',
|
||||
userid: this.userId,
|
||||
token: this.userToken,
|
||||
url: $A.apiUrl('users/umeng/alias')
|
||||
});
|
||||
}, 6000)
|
||||
|
||||
@ -66,6 +66,7 @@
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: 'DialogDroupWordChain',
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user