request->only(['page' => 1, 'size' => 10, 'status' => '', 'company_id' => '', 'card_id' => ''], 'post'); return InventoryExchangeLogic::list($param); } //添加兑换商品库存 public function add() { $param = $this->request->only(['account_id', 'good_id', 'inventory'], 'post'); $val = Validate::rule(Config::get('validate_rules.InventoryExchangeAdd')); if (!$val->check($param)) throw new ValidateException($val->getError()); return InventoryExchangeLogic::add($param); } //获取兑换商品库存详情 public function read() { $id = $this->request->post('id/d', 0); return InventoryExchangeLogic::read($id); } //编辑兑换商品库存 public function edit() { $param = $this->request->only(['id', 'company_id', 'card_id', 'video_list', 'remark' => ''], 'post'); $val = Validate::rule(array_merge(Config::get('validate_rules.VideoGroupAdd'), ['id|兑换商品库存id' => 'require|number|gt:0'])); if (!$val->check($param)) throw new ValidateException($val->getError()); return InventoryExchangeLogic::edit($param); } //兑换商品库存启禁用 public function status() { $param = $this->request->only(['id','status'],'post'); $val = Validate::rule(Config::get('validate_rules.status')); if (!$val->check($param)) throw new ValidateException($val->getError()); return InventoryExchangeLogic::status($param); } //删除兑换商品库存 public function delete() { $id = $this->request->post('id/d', 0); return InventoryExchangeLogic::delete($id); } //兑换商品库存置顶 public function top() { $param = $this->request->only(['id','is_top'],'post'); $val = Validate::rule([ 'id' => 'require|number|gt:0', 'is_top|是否置顶' => 'require|number|in:' . CommonModel::$top_no . ',' . CommonModel::$top_yes, ]); if (!$val->check($param)) throw new ValidateException($val->getError()); return InventoryExchangeLogic::top($param); } }