model = new \app\admin\model\ykjp\sell\Sellaudit; $this->view->assign("typeList", $this->model->getTypeList()); $this->view->assign("statusListList", $this->model->getStatusListList()); } /** * 查看详情 */ public function detail($ids) { list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $detail = $this->model ->where($where) ->where('firmid', $this->auth->firmid) ->order($sort, $order) ->where("id", $ids) ->select(); $productModel = new \app\admin\model\ykjp\sell\Product; $product = $productModel->with(['products'])->where("sell_id", $ids)->select(); $arr; if ($product) { foreach ($product as $key => $value) { $a = json_decode($value['products']['prop']); $value['products']['prop'] = $this->model->object_array($a); $arr[] = $value; } } $this->assign("detail", $detail); $this->assign("product", $product); return $this->view->fetch("detail"); } /** * 审核 */ public function audit($ids = null) { $modelProduct = new \app\admin\model\ykjp\sell\Product; list($where, $sort, $order, $offset, $limit) = $this->buildparams(); //判断通过还是驳回 (pass 通过 reject 驳回) if ($this->request->param("act") == "pass") { //通过 $data = array("status_list" => 3, "purman_id" => $this->auth->id, "updatetime" => time()); $update = $this->model ->where("status_list", 1) ->where('firmid', $this->auth->firmid) ->where("id", "in", $ids) ->update($data); if ($update) { $this->success(null, null, array("result" => "success")); } $this->error("operation fail"); } elseif ($this->request->param("act") == "reject") { //驳回 $cause = $this->request->param('cause'); //驳回原因 $data = array("status_list" => 2, "purman_id" => $this->auth->id, "updatetime" => time(), 'cause' => $cause); $update = $this->model ->where("status_list", 1) ->where('firmid', $this->auth->firmid) ->where("id", "in", $ids) ->update($data); if ($update) { $this->success(null, null, array("result" => "success")); } $this->error("operation fail"); } $this->error("Illegal operation"); } }