dyjh 6 gadi atpakaļ
vecāks
revīzija
ec51dee03b

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

xqd xqd xqd xqd
@@ -1831,7 +1831,7 @@ class AlbumController extends Controller
 
         $res_account = $this->accountMesage($g_open_id,$weChatApp,$name,$content);
         //   \Log::info($res_account);
-        if($user && $formId && (!$weChatApp->G_app_id || !$weChatApp->G_app_secret)){
+        if($user && $formId && !empty($weChatApp->wxFurniture_template_id) && (!$weChatApp->G_app_id || !$weChatApp->G_app_secret)){
             $config_app = [
                 'app_id' => $weChatApp->app_id,
                 'secret' => $weChatApp->app_secret,
@@ -1840,7 +1840,7 @@ class AlbumController extends Controller
             $app_x = Factory::miniProgram($config_app);
             $res = $app_x->template_message->send([
                 'touser' => $open_id,
-                'template_id' => '9PDTfnhsRvdNwpPMIcYLL7wQF4SZkB8-9ZhXUfthbmw',
+                'template_id' => $weChatApp->wxFurniture_template_id,
                 'page' => 'pages/sell/sell',
                 'form_id' => $formId->form_id,
                 'data' => [
@@ -1873,7 +1873,7 @@ class AlbumController extends Controller
         // Cache::flush();
         $value = Cache::get($g_open_id);
         \Log::info($value);\Log::info('2225');
-        if ($g_open_id && (!$value || ($value + 60) <= time())) {
+        if ($g_open_id && !empty($weChatApp->wxaccount_template_id) && (!$value || ($value + 60) <= time())) {
             Cache::put($g_open_id, time(), 1);
             $config = [
                 'app_id' => $weChatApp->G_app_id,
@@ -1883,7 +1883,7 @@ class AlbumController extends Controller
             $app = Factory::officialAccount($config);
             $res = $app->template_message->send([
                 'touser' => $g_open_id,
-                'template_id' => 'lXMh2Xjg62C4LjB50QVi9ETbcvU21WElvqNCHBCsWuM',
+                'template_id' => $weChatApp->wxaccount_template_id,
                 'url' => '',
                 'data' => [
                     'keyword1' => $name,

+ 2 - 0
app/Models/AlbumManufacturerModel.php

xqd
@@ -39,6 +39,8 @@ class AlbumManufacturerModel extends BaseModel
         'banner',
         'logo',
         'service_app_secret',
+        'wxFurniture_template_id',
+        'wxaccount_template_id',
         'service_app_id',
         'goods_app_id',
         'xyx_id',

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

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddTemplateIdToAlbumManufacturer extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+            $table->string('wxFurniture_template_id', 255)->default(null)->nullable();
+            $table->string('wxaccount_template_id', 255)->default(null)->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 23 - 2
resources/views/admin/album/manufacturer/edit.blade.php

xqd xqd xqd xqd
@@ -147,6 +147,17 @@
                                                    aria-required="true" placeholder="">
                                         </div>
 
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">公众号TemplateID</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_wxaccount_template_id" name="data[wxaccount_template_id]"
+                                                   class="form-control"
+                                                   value="{{ $data['wxaccount_template_id'] or ''}}" placeholder="">
+                                        </div>
+
                                     </div>
                                         <div class="form-group">
 
@@ -315,7 +326,7 @@
                                     </div>--}}
                                         <div class="form-group">
 
-                                            <label class="control-label col-sm-3">画册小游戏appID</label>
+                                            <label class="control-label col-sm-3">画册appID</label>
 
                                             <div class="col-sm-9">
                                                 <input id="data_xyx_id" name="data[xyx_id]" class="form-control"
@@ -326,7 +337,7 @@
                                         </div>
                                         <div class="form-group">
 
-                                            <label class="control-label col-sm-3">画册小游戏appSecret</label>
+                                            <label class="control-label col-sm-3">画册appSecret</label>
 
                                             <div class="col-sm-9">
                                                 <input id="data_xyx_secret" name="data[xyx_secret]" class="form-control"
@@ -334,6 +345,16 @@
                                                        aria-required="true" placeholder="">
                                             </div>
 
+                                        </div>
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">画册TemplateId</label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_wxFurniture_template_id" name="data[wxFurniture_template_id]" class="form-control"
+                                                       value="{{ $data['wxFurniture_template_id'] or ''}}" placeholder="">
+                                            </div>
+
                                         </div>
                                         <div class="form-group">