quguofeng 1 سال پیش
والد
کامیت
dfb4d49357
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      application/mall/controller/GoodsTwoCate.php

+ 4 - 3
application/mall/controller/GoodsTwoCate.php

@@ -37,6 +37,7 @@ class GoodsTwoCate extends Controller
         if(empty($id)){
             $this->error('非法操作');
         }
+        $this->app->session->set('pid',$id);
         $query = $this->_query($this->table)->like('title');
         $query->where('level',2)->where('pid',$id)->where('is_deleted',0)->order('id asc')->page();
     }
@@ -81,19 +82,19 @@ class GoodsTwoCate extends Controller
 
     /**
      * 表单数据处理
-     * @param array $vo
+     * @param array $data
      * @throws \ReflectionException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\exception\DbException
      */
-    protected function _form_filter(&$vo)
+    protected function _form_filter(&$data)
     {
         if ($this->request->isGet()) {
 
         }
         if($this->request->isPost() && in_array($this->request->action(),['add','edit'])){
-
+            $data['pid'] = $this->app->session->get('pid');
         }
     }