sgd521 2 роки тому
батько
коміт
0774ca996b

+ 12 - 0
app/admin/controller/SupplierExamine.php

@@ -59,6 +59,18 @@ class SupplierExamine extends BaseAdmin
         $this->addLog("商家申请通过id:" . $apply_id);
         return $shop_apply_model->applyPass($apply_id,$member_id);
     }
+    /**
+     * 删除广告位
+     */
+    public function deleteBanner()
+    {
+        if (request()->isAjax()) {
+            $ap_ids = input('apply_id', 0);
+            $shop_apply_model = new SupplierExamineModel();
+            return  $shop_apply_model ->deleteBanner([ [ 'id', '=', $ap_ids ] ]);
+        }
+    }
+
 
     /**
      * 申请失败

+ 27 - 0
app/admin/view/supplierexamine/index.html

@@ -299,6 +299,9 @@
                 case 'edit_apply' : //修改资料
                     location.href = ns.url("admin/shopapply/editApply?apply_id=" + data.apply_id)
                     break;
+                case 'delete': //删除
+                    deletePosition(data.id);
+                    break;
             }
         });
 
@@ -350,6 +353,30 @@
                 });
             });
         }
+        function deletePosition(data) {
+            if (repeat_flag) return false;
+            repeat_flag = true;
+
+            layer.confirm('确定要删除吗?', function() {
+                $.ajax({
+                    url: ns.url("admin/franchisee_examine/deleteBanner"),
+                    data: { "apply_id": data,},
+                    dataType: 'JSON',
+                    type: 'POST',
+                    success: function(res) {
+                        layer.msg(res.message);
+                        repeat_flag = false;
+
+                        if (res.code == 0) {
+                            table.reload();
+                        }
+                    }
+                });
+            }, function() {
+                layer.close();
+                repeat_flag = false;
+            });
+        }
         function applyRefuse(data) {
             layer.confirm('确定要禁用吗?', function () {
                 $.ajax({

+ 10 - 0
app/model/member/SupplierExamine.php

@@ -171,5 +171,15 @@ class SupplierExamine extends BaseModel
             return $this->error('', $e->getMessage());
         }
     }
+    /**
+     * 删除广告
+     * @param array $condition
+     */
+    public function deleteBanner($condition)
+    {
+        $res = model('supplier_examine')->delete($condition);
+        Cache::tag("supplier_examine")->clear();
+        return $this->success($res);
+    }
 
 }