dyjh 6 年之前
父节点
当前提交
16c985f49d

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

xqd
@@ -396,7 +396,7 @@ class AlbumController extends Controller
             $set_show_price = $agent_me->is_show_ma_price;
         }
 
-        $goods = $goods->select('id','cover_pic','thumb','name','style','hot_cake','news','price_default')->orderByDesc('sort')->paginate(9);
+        $goods = $goods->select('id','cover_pic','thumb','name','style','hot_cake','news','price_default','ma_price','ma_price_comment')->orderByDesc('sort')->paginate(9);
 
         foreach($goods as $key =>$val){
             if($userAuth->is_dealer != 1){

+ 2 - 0
app/Models/AlbumProductModel.php

xqd
@@ -38,6 +38,8 @@ class AlbumProductModel extends BaseModel
                            'store_id',
                            'name',
                            'price_default',
+                           'ma_price',
+                           'ma_price_comment',
                            'detail_pic',
                            'cat_id',
                            'specifications_img',

+ 34 - 0
database/migrations/2019_03_29_174712_add_column_ma_price_to_album_product.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnMaPriceToAlbumProduct extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_product', function (Blueprint $table) {
+            //
+            $table->decimal('ma_price', 8, 2)->nullable()->default(0)->comment('出厂价');
+            $table->string('ma_price_comment', 255)->nullable()->default(null)->comment('出厂价备注');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_product', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 16 - 0
resources/views/admin/album/product/edit.blade.php

xqd
@@ -68,6 +68,22 @@
                                     </div>
                                 </div>
                                 <div class="form-group">
+
+                                    <label class="control-label col-sm-3">出厂价</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_ma_price" name="data[ma_price]" type="number" class="form-control" value="{{ $data['ma_price'] or ''}}" required="" aria-required="true"  placeholder="">
+                                    </div>
+                                </div>
+                                <div class="form-group">
+
+                                    <label class="control-label col-sm-3">出厂价备注</label>
+
+                                    <div class="col-sm-9">
+                                        <input id="data_ma_price_comment" name="data[ma_price_comment]" class="form-control" value="{{ $data['ma_price_comment'] 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">

+ 0 - 1
routes/api.php

xqd
@@ -22,7 +22,6 @@ use Illuminate\Http\Request;
 //
 $api = app('Dingo\Api\Routing\Router');
 
-
 $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($api) {
 
     $api->post('attachment/upload', [