get_goods_stock_log_list = CommonConstant::get_goods_stock_log_list(); } /** * 列表 * @auth true * @menu true * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function index() { $this->type = $type = input('type') ?: 0; $this->goods_id = $goods_id = input('goods_id') ?: 0; $this->title = '商品入库出库记录'; $data = model::when($type > 0, function ($query) use ($type) { $query->where('type', $type); }) ->where('goods_id', $goods_id) ->order('id desc'); self::_init($data); } }