dyjh 6 years ago
parent
commit
ae7d15ee59

+ 1 - 0
app/Http/Controllers/Api/V1/AlbumController.php

xqd
@@ -516,6 +516,7 @@ class AlbumController extends Controller
      *          "name": "简约",
      *          "detail_pic": ""
      *          "price": "",
+     *          "price_default": "",
      *          "mobile": "",
      *          "address": "",
      *          "realname": "",

+ 1 - 0
app/Models/AlbumProductModel.php

xqd
@@ -37,6 +37,7 @@ class AlbumProductModel extends BaseModel
     protected $fillable = [
                            'store_id',
                            'name',
+                           'price_default',
                            'detail_pic',
                            'cat_id',
                            'specifications_img',

+ 33 - 0
database/migrations/2018_12_25_133836_add_column_price_to_album_product.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnPriceToAlbumProduct extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_product', function (Blueprint $table) {
+            //
+            $table->double('price_default')->default(0)->comment('默认价格');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_product', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 10 - 2
resources/views/admin/album/product/edit.blade.php

xqd
@@ -58,8 +58,16 @@
                        </select>
                    </div>
 
-                </div>    
-                <div class="form-group">
+                </div>
+                                <div class="form-group">
+
+                                    <label class="control-label col-sm-3">默认价格</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_store_id" name="data[price_default]" class="form-control" value="{{ $data['price_default'] or ''}}" required="" aria-required="true"  placeholder="">
+                                    </div>
+                                </div>
+                                <div class="form-group">
                                     
                  <label class="control-label col-sm-3">尺寸图片(1920*1080)</label>
                     <div class="col-sm-9">

+ 2 - 0
resources/views/admin/album/product/index.blade.php

xqd xqd
@@ -39,6 +39,7 @@
             <th class="sorting" data-sort="id"> ID </th>
             <th class="sorting" data-sort="name"> 名称 </th>
             <th class="sorting" data-sort="cat_id"> 分类 </th>
+            <th class="sorting" data-sort="price_default"> 默认价格 </th>
             <th class="sorting" data-sort="specifications_img"> 规格图片 </th>
             <th class="sorting" data-sort="install_img"> 安装图片 </th>
             <th class="sorting" data-sort="style"> 风格 </th>
@@ -54,6 +55,7 @@
             <td>{{ $item->id }}</td>
             <td>{{ $item->name }}</td>
             <td>{{ $item->cat_name }}</td>
+            <td>{{ $item->price_default }}</td>
             <td><img src="{{ $item->specifications_img }}" width="50"/></td>
             <td><img src="{{ $item->install_img }}" width="50"/></td>
             <td>{{ $item->style_name }}</td>