WIN-2308041133\Administrator 1 rok pred
rodič
commit
58dce1e453

+ 12 - 0
addons/wechat/Wechat.php

@@ -73,6 +73,18 @@ class Wechat extends Addons
                             ['name' => 'wechat/response/select', 'title' => '选择'],
                             ['name' => 'wechat/response/multi', 'title' => '批量更新'],
                         ]
+                    ],
+                    [
+                        'name'    => 'wechat/plan',
+                        'title'   => '微信模版列表管理',
+                        'icon'    => 'fa fa-list',
+                        'sublist' => [
+                            ['name' => 'wechat/plan/index', 'title' => '查看'],
+                            ['name' => 'wechat/plan/add', 'title' => '添加'],
+                            ['name' => 'wechat/plan/edit', 'title' => '修改'],
+                            ['name' => 'wechat/plan/del', 'title' => '删除'],
+                            ['name' => 'wechat/plan/multi', 'title' => '批量更新'],
+                        ]
                     ]
                 ]
             ]

+ 4 - 4
application/admin/controller/wechat/Plan.php

@@ -46,17 +46,17 @@ class Plan extends Backend
     }
 
     /**
-     * 判断文本是否唯一
+     * 判断价格是否唯一
      * @internal
      */
     public function check_text_unique()
     {
         $row = $this->request->post("row/a");
         $except = $this->request->post("except");
-        $text = isset($row['text']) ? $row['text'] : '';
-        if ($this->model->where('text', $text)->where(function ($query) use ($except) {
+        $text = isset($row['price']) ? $row['price'] : '';
+        if ($this->model->where('price', $text)->where(function ($query) use ($except) {
                 if ($except) {
-                    $query->where('text', '<>', $except);
+                    $query->where('price', '<>', $except);
                 }
             })->count() == 0) {
             $this->success();