getList(array_merge(['status' => -1,'is_virtual' => 2], $this->postData())); // 分类 $category = CategoryModel::getALL(); return $this->renderSuccess('', compact('list', 'category')); } /** * 编辑 */ public function edit($product_id) { $model = new GoodCouponModel(); if ($this->request->isGet()) { $good_coupon= GoodCouponModel::detail($product_id); return $this->renderSuccess('', compact('good_coupon')); } if ($model->edit($this->postData())) { return $this->renderSuccess('操作成功'); } return $this->renderError($model->getError() ?: '操作失败'); } /** * 设置状态 */ public function setStatus($productIds, $is_good) { $model = new GoodCouponModel(); if ($model->setStatus($productIds, $is_good)) { return $this->renderSuccess('操作成功'); } return $this->renderError($model->getError() ?: '操作失败'); } }