mirror of
https://github.com/easychen/pushdeer.git
synced 2025-01-09 22:45:37 +08:00
add key
This commit is contained in:
parent
eda58634dc
commit
6c4329a082
@ -26,7 +26,7 @@ class PushDeerMessageController extends Controller
|
|||||||
$limit = 100;
|
$limit = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pd_messages = Message::where('uid', $_SESSION['uid'])->orderBy('id', 'DESC')->offset(0)->limit($limit)->get(['id', 'uid', 'text', 'desp', 'type','created_at']);
|
$pd_messages = Message::where('uid', $_SESSION['uid'])->orderBy('id', 'DESC')->offset(0)->limit($limit)->get(['id', 'uid', 'text', 'desp', 'type','pushkey_name','created_at']);
|
||||||
|
|
||||||
return http_result(['messages' => $pd_messages]);
|
return http_result(['messages' => $pd_messages]);
|
||||||
}
|
}
|
||||||
@ -63,6 +63,7 @@ class PushDeerMessageController extends Controller
|
|||||||
$the_message['desp'] = $validated['desp'];
|
$the_message['desp'] = $validated['desp'];
|
||||||
$the_message['type'] = $validated['type'];
|
$the_message['type'] = $validated['type'];
|
||||||
$the_message['readkey'] = $readkey;
|
$the_message['readkey'] = $readkey;
|
||||||
|
$the_message['pushkey_name'] = $key->name;
|
||||||
$pd_message = Message::create($the_message);
|
$pd_message = Message::create($the_message);
|
||||||
|
|
||||||
$devices = PushDeerDevice::where('uid', $key->uid)->get();
|
$devices = PushDeerDevice::where('uid', $key->uid)->get();
|
||||||
|
@ -11,7 +11,7 @@ class PushDeerMessage extends Model
|
|||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'readkey',
|
'readkey',
|
||||||
'pushkey',
|
'pushkey_name',
|
||||||
'text',
|
'text',
|
||||||
'desp',
|
'desp',
|
||||||
'uid',
|
'uid',
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class MessageAddPushKey extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('push_deer_messages', function (Blueprint $table) {
|
||||||
|
$table->string('pushkey_name');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('push_deer_messages', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('pushkey_name');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user