想通过直接修改数据库不用后台导入商品数据,导入之后可以看到商品缩略图,但是点击进去详情却说找不到页面

安装报错 · an94er · 于 5年前 发布 · 1626 次阅读

事情原因

在mongodb里面插入了一行数据 在MySQL里面的product_flat_qty为商品加了数量 在mongodb的full_searchproduct** 等几个full开头的数据表加数据

可以说跟后台手动添加的差不多了,我对比的是这样,但是仍然只是在列表看到缩略图,点进去详情就是没找到页面

错误提示

OPPS! We Couldn’t Find this Page Please contact us if you think this is a server error, Thank you. Bring me back Home 商品列表可以看到缩略图点击进去看详情找不到页面

请问大神

这样纯数据库导入还差那个表我没修改吗?

共收到 1 条回复
Fecmall#15年前 0 个赞

1.关于产品导入,fecshop已经做好了api,你不需要自己再造轮子了,

参看AppApi端的产品新增api: http://www.fecshop.com/doc/fecshop-guide/develop/cn-1.0/guide-fecshop-api-product-addone.html

2.对于这个api的代码,参看:https://github.com/fecshop/yii2_fecshop/blob/master/app/appapi/modules/V1/controllers/ProductController.php 中的

/**
     * Add One Api:新增一条记录的api
     */
    public function actionAddone(){
        //var_dump(Yii::$app->request->post());exit;
        $data = Yii::$service->product->productapi->insertByPost();
        return $data;
    }

Yii::$service->product->productapi->insertByPost(); 就是:https://github.com/fecshop/yii2_fecshop/blob/master/services/product/ProductApi.php#L464:33 public function insertByPost($post = []){ 方法

3.保存产品涉及到很多的东西,具体细节这里就不说了,上面已经给予代码文件,有兴趣自己去阅读代码。

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics