正在显示
2 个修改的文件
包含
9 行增加
和
2 行删除
@@ -42,6 +42,12 @@ class User extends Backend | @@ -42,6 +42,12 @@ class User extends Backend | ||
42 | { | 42 | { |
43 | if ($this->request->isPost()) { | 43 | if ($this->request->isPost()) { |
44 | $params = $this->request->post("row/a"); | 44 | $params = $this->request->post("row/a"); |
45 | + $product_id = null; | ||
46 | + if(isset($params['product_id']) && !empty($params['product_id'])){ | ||
47 | + $product_id = $params['product_id']; | ||
48 | + unset($params['product_id']); | ||
49 | + } | ||
50 | + | ||
45 | if ($params) { | 51 | if ($params) { |
46 | if ($this->dataLimit && $this->dataLimitFieldAutoFill) { | 52 | if ($this->dataLimit && $this->dataLimitFieldAutoFill) { |
47 | $params[$this->dataLimitField] = $this->auth->id; | 53 | $params[$this->dataLimitField] = $this->auth->id; |
@@ -66,8 +72,7 @@ class User extends Backend | @@ -66,8 +72,7 @@ class User extends Backend | ||
66 | 72 | ||
67 | $result = $this->model->allowField(true)->insert($params,false,true); | 73 | $result = $this->model->allowField(true)->insert($params,false,true); |
68 | if ($result !== false) { | 74 | if ($result !== false) { |
69 | - if(isset($params['product_id']) && !empty($params['product_id'])){ | ||
70 | - | 75 | + if($product_id){ |
71 | $product = new \app\admin\model\Product(); | 76 | $product = new \app\admin\model\Product(); |
72 | $product = $product->where(['id'=>$params['product_id']])->find(); | 77 | $product = $product->where(['id'=>$params['product_id']])->find(); |
73 | if(!empty($product)){ | 78 | if(!empty($product)){ |
-
请 注册 或 登录 后发表评论