add migration for notification. update booking confirmation

This commit is contained in:
weiweitoo
2018-07-21 14:15:42 +08:00
parent 1b874d0800
commit 81bf3ac585
7 changed files with 141 additions and 30 deletions
@@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class NotificationController extends Controller
{
//
}
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Notification extends Model
{
protected $fillable = ['detail','user_id'];
}
@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNotificationTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->increments('id');
$table->string('detail');
$table->unsignedInteger('user_id');
$table->timestamps();
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}
+1
View File
@@ -28,6 +28,7 @@ class DatabaseSeeder extends Seeder
$this->call(SettingActiveBankSeeder::class);
$this->call(SettingTaxRateSeeder::class);
$this->call(SettingBillingChargeSeeder::class);
$this->call(NotificationSeeder::class);
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Seeder;
use App\User;
use Carbon\Carbon;
class NotificationSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$user = User::where("email", "user@example.com")->first();
$admin = User::where("email", "admin@example.com")->first();
DB::table('notifications')->insert([
'detail' => 'This is an user seeder notification',
'user_id' => $user->id,
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
]);
DB::table('notifications')->insert([
'detail' => 'This is an admin seeder notification',
'user_id' => $admin->id,
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s'),
]);
}
}
+48 -30
View File
@@ -141,19 +141,19 @@
<!-- Form_popup -->
<el-dialog :visible.sync="dialogFormVisible" :fullscreen="true" title="Booking" center>
<el-form ref="bookingForm" :model="bookingForm" :rules="rules">
<el-form ref="bookingForm" :model="bookingForm[0]" :rules="rules">
<div align="center">
<el-form-item prop="account_name">
<el-input v-model="bookingForm.account_name" placeholder="China Beneficiary Account" style="width: 80%" required="true" />
<el-input v-model="bookingForm[0].account_name" placeholder="China Beneficiary Account" style="width: 80%" required="true" />
</el-form-item>
<el-form-item prop="bank_name">
<el-input v-model="bookingForm.bank_name" type="text" placeholder="Bank Name / AliPay / WechatPay" style="width: 80%" />
<el-input v-model="bookingForm[0].bank_name" type="text" placeholder="Bank Name / AliPay / WechatPay" style="width: 80%" />
</el-form-item>
<el-form-item prop="bank_branch">
<el-input v-model="bookingForm.bank_branch" type="text" placeholder="Branch / 分行/支行" style="width: 80%" />
<el-input v-model="bookingForm[0].bank_branch" type="text" placeholder="Branch / 分行/支行" style="width: 80%" />
</el-form-item>
<el-form-item prop="account_num">
<el-input v-model="bookingForm.account_num" type="text" placeholder="Account Number / AliPay_ID / WechatPay_ID" style="width: 80%"
<el-input v-model="bookingForm[0].account_num" type="text" placeholder="Account Number / AliPay_ID / WechatPay_ID" style="width: 80%"
/>
</el-form-item>
<el-form-item>
@@ -178,25 +178,21 @@
<td>Customer Marking : </td>
<td> {{ bookingConfirmTable.marking }}</td>
</tr>
<tr>
<td>Payment for (Order No.) : </td>
<td> {{ bookingConfirmTable.payment_order }}</td>
</tr>
<tr>
<td>Payment Method : </td>
<td> {{ bookingConfirmTable.payment_method }}</td>
</tr>
<tr>
<td>CNY/RMB : </td>
<td> {{ bookingConfirmTable.amount }}</td>
<td>Remarks : </td>
<td> {{ bookingConfirmTable.remark }}</td>
</tr>
<tr>
<td>+ Service Charge : </td>
<td> RMB {{ bookingConfirmTable.service_charge }}</td>
</tr>
<tr>
<td> RATE :</td>
<td> {{ bookingConfirmTable.rate }}</td>
</tr>
<tr>
<td>China Beneficiary Acc :</td>
<td> {{ bookingForm.account_name }}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>CNY/RMB :</td>
@@ -235,11 +231,40 @@
</td>
</tr>
<tr>
<td>Bank in Amount :</td>
<td>Bank In Amount :</td>
<td>
<b> RM {{ bookingConfirmTable.bankin_amount }}</b>
</td>
</tr>
<tr>
<td>China Beneficiary Acc :</td>
<td></td>
</tr>
<tr>
<td>
<div v-for="(item,index) in bookingForm" align="center">
{{index+1}}) {{ item.account_name }} {{ item.account_num }}
<br/>
</div>
</td>
<td>
</td>
</tr>
<tr>
<td>Bank In Amount :</td>
<td><b>RM {{ bookingConfirmTable.bankin_amount }}</b></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td align="center" colspan="2">
<b>CIEF WORLDWIDE SDN. BHD.(1134596-M)</b>
<br/>
<b>MBB 568603010762</b>
</td>
</tr>
</tbody>
</table>
<span slot="footer" class="dialog-footer">
@@ -343,13 +368,12 @@ export default {
amount: '',
rate: ''
},
bookingForm: {
// amount: '',
bookingForm: [{
account_name: '',
bank_name: '',
bank_branch: '',
account_num: ''
},
}],
rules: {
amount: [{
required: true,
@@ -459,8 +483,6 @@ export default {
})
})
},
makePagination(data){
let pagination ={
current_page: data.current_page,
@@ -511,12 +533,11 @@ export default {
this.loading = false
console.log(response)
this.bookingConfirmTable = response.data;
this.bookingConfirmTable.payment_for = 'Full Payment';//For future purpose?
this.bookingConfirmTable.remark = '';//For future purpose?
this.bookingConfirmTable.payment_for = 'Full Payment';//For future purpose
this.bookingConfirmTable.remark = '';//For future purpose
this.bookingConfirmTable.payment_order = '';//For future purpose
this.dialogFormVisible = false
this.dialogFormVisible1 = true
console.log(this.bookingConfirmTable);
console.log(this.bookingForm);
})
.catch((error) => {
this.$message({
@@ -550,8 +571,6 @@ export default {
amount: this.booking.amount,
term: this.term
}
console.log(newBooking)
axios.post('api/booking', newBooking)
.then((response) => {
this.loading = false
@@ -560,7 +579,6 @@ export default {
name: 'booking.user.upload',
params: {id: response.data.id }
})
// pass variable to another router
})
.catch((error) => {
+2
View File
@@ -462,6 +462,7 @@ class ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4
'App\\Http\\Middleware\\VerifyCsrfToken' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyCsrfToken.php',
'App\\Invoice' => __DIR__ . '/../..' . '/app/Invoice.php',
'App\\Marking' => __DIR__ . '/../..' . '/app/Marking.php',
'App\\Notification' => __DIR__ . '/../..' . '/app/Notification.php',
'App\\Notifications\\ResetPassword' => __DIR__ . '/../..' . '/app/Notifications/ResetPassword.php',
'App\\OAuthProvider' => __DIR__ . '/../..' . '/app/OAuthProvider.php',
'App\\Permission' => __DIR__ . '/../..' . '/app/Permission.php',
@@ -2852,6 +2853,7 @@ class ComposerStaticInit0eb1f3eb0d8144627e65b3e93f0783e4
'Namshi\\JOSE\\Signer\\SecLib\\RSA' => __DIR__ . '/..' . '/namshi/jose/src/Namshi/JOSE/Signer/SecLib/RSA.php',
'Namshi\\JOSE\\Signer\\SignerInterface' => __DIR__ . '/..' . '/namshi/jose/src/Namshi/JOSE/Signer/SignerInterface.php',
'Namshi\\JOSE\\SimpleJWS' => __DIR__ . '/..' . '/namshi/jose/src/Namshi/JOSE/SimpleJWS.php',
'NotificationSeeder' => __DIR__ . '/../..' . '/database/seeds/NotificationSeeder.php',
'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider' => __DIR__ . '/..' . '/nunomaduro/collision/src/Adapters/Laravel/CollisionServiceProvider.php',
'NunoMaduro\\Collision\\Adapters\\Laravel\\ExceptionHandler' => __DIR__ . '/..' . '/nunomaduro/collision/src/Adapters/Laravel/ExceptionHandler.php',
'NunoMaduro\\Collision\\Adapters\\Laravel\\Inspector' => __DIR__ . '/..' . '/nunomaduro/collision/src/Adapters/Laravel/Inspector.php',