致力于提供有竞争力的软件解决方案和服务,德尚网络欢迎您!
技术/产品咨询
技术/产品咨询
    • - 微信扫一扫 -

      QQ:181814630

      电话:15116362044

DSKMS演示
  • DSKMS(内容付费系统)演示地址及账号
    DSKMS交流群:553212556
    演示角色 演示地址 账号 密码
    后台PC端 点击进入 dskms 123456
    用户PC端 点击进入 buyer 123456
    机构PC端 点击进入 buyer 123456
    用户手机端 点击进入 buyer 123456
    机构手机端 点击进入 buyer 123456
    DSKMS(内容付费系统)uniapp移动端二维码演示地址
    • 用户端

    • 机构端

    • 用户端安卓APP
      (使用浏览器打开)

    • 商家端安卓APP
      (使用浏览器打开)

DSShop演示
  • DSShop(单店铺系统)演示地址及账号
    DSShop交流群:549770277
    演示角色 演示地址 账号 密码
    后台PC端 点击进入 dsshop 123456
    用户PC端 点击进入 buyer 123456
    手机端 点击进入 buyer 123456
    DSShop(单店铺系统)uniapp版移动端二维码演示地址
    • 用户端

    • 用户手机端安卓APP
      (使用浏览器打开)

DSESN演示
  • DSESN(社区团购系统)uniapp版演示地址及账号
    dsesn交流群:553212556
    演示角色 演示地址 账号 密码
    管理员后台 点击进入 dsesn 123456
    供应商后台 点击进入 buyer 123456
    用户端 点击进入 test001 123456
    仓库端 点击进入 13700000000 123456
    团长端 点击进入 13800000000 123456
    DSESN(社区团购系统))uniapp移动端二维码演示地址
    • 用户端

    • 仓库端

    • 团长端

DSO2O演示
  • DSO2O(外卖/上门服务/跑腿系统)演示地址及账号
    DSO2O交流群:549770277
    演示角色 演示地址 账号 密码
    后台PC端 点击进入 dso2o 123456
    用户PC端 点击进入 buyer 123456
    卖家PC端 点击进入 buyer 123456
    服务机构PC端 点击进入 后台添加
    用户手机端 点击进入 buyer 123456
    商家手机端 点击进入 buyer 123456
    配送员 点击进入 测试配送员 123456
    服务机构手机端 点击进入 test1 123456
    DSO2O(外卖/上门服务/跑腿系统)uniapp移动端二维码演示地址
    • 用户端

    • 商家端

    • 配送员管理端

    • 服务机构端

    • 用户端安卓APP
      (使用浏览器打开)

    • 商家端安卓APP
      (使用浏览器打开)

    • 配送员管理安卓APP
      (使用浏览器打开)

    • 服务机构安卓APP
      (使用浏览器打开)

DSMall演示
  • DSMall(多店铺商城系统)演示地址及账号
    DSMall交流群:10235778
    演示角色 演示地址 账号 密码
    后台PC端 点击进入 dsmall 123456
    用户PC端 点击进入 buyer 123456
    商家PC端 点击进入 buyer 123456
    用户手机端 点击进入 buyer 123456
    商家手机端 点击进入 buyer 123456
    门店手机端 点击进入 seller 123456
    DSMall(多店铺商城系统)uniapp移动端二维码演示地址
    • 用户端

    • 商家端

    • 门店端

    • 用户安卓APP
      (使用浏览器打开)

    • 商家安卓APP
      (使用浏览器打开)

    • 门店安卓APP
      (使用浏览器打开)

商品模块

商品由商家发布,可以根据实际情况设置多种属性,多个规格。商品模块所涉及的表有:

goods、goodscommongoodsimages。他们的关系如下图

 

卖家添加商品时,所用到的控制器是Sellergoodsadd,第一步add_step_one操作显示卖家绑定的分类

        // 实例化商品分类模型
        $goodsclass_model = model('goodsclass');
        // 商品分类
        $goods_class = $goodsclass_model->getGoodsclass(session('store_id'));

第二步add_step_two操作如果不是自营店铺或者没有绑定全部分类则检查所选商品分类是否在卖家绑定的分类中

        // 如果不是自营店铺或者自营店铺未绑定全部商品类目,读取绑定分类
        if (!check_platform_store_bindingall_goodsclass()) {
            //商品分类  支持批量显示分类
            $storebindclass_model = model('storebindclass');
            $goods_class = model('goodsclass')->getGoodsclassForCacheModel();
            $where['store_id'] = session('store_id');
            $class_2 = isset($goods_class[$gc_id]['gc_parent_id'])?$goods_class[$gc_id]['gc_parent_id']:0;
            $class_1 = isset($goods_class[$class_2]['gc_parent_id'])?$goods_class[$class_2]['gc_parent_id']:0;
            $where['class_1'] = ($class_1>0)?$class_1:(($class_2>0)?$class_2:$gc_id);
            $where['class_2'] = ($class_1>0)?$class_2:(($class_2>0)?$gc_id:0);
            $where['class_3'] = ($class_1>0 && $class_2>0)?$gc_id:0;
            $bind_info = $storebindclass_model->getStorebindclassInfo($where);
            if (empty($bind_info)) {
                $where['class_3'] = 0;
                $bind_info = $storebindclass_model->getStorebindclassInfo($where);
                if (empty($bind_info)) {
                    $where['class_2'] = 0;
                    $where['class_3'] = 0;
                    $bind_info = $storebindclass_model->getStorebindclassInfo($where);
                    if (empty($bind_info)) {
                        $where['class_1'] = 0;
                        $where['class_2'] = 0;
                        $where['class_3'] = 0;
                        $bind_info = model('storebindclass')->getStorebindclassInfo($where);
                        if (empty($bind_info)) {
                            $this->error(lang('store_goods_index_again_choose_category2'));
                        }
                    }
                }
            }
        }

 

获取所选分类下所关联的商品属性与规格

        // 获取类型相关数据
        $typeinfo = model('type')->getAttribute($goods_class['type_id'], session('store_id'), $gc_id);
        list($spec_json, $spec_list, $attr_list, $brand_list) = $typeinfo;

 

商品图片上传时,通过ajax异步上传图片到Sellergoodsadd/image_upload

检查是否超过可上传的图片数量

        // 判断图片数量是否超限
        $album_model = model('album');
        $album_limit = $this->store_grade['storegrade_album_limit'];
        if ($album_limit > 0) {
            $album_count = $album_model->getCount(array('store_id' => session('store_id')));
 
            if ($album_count >= $album_limit) {
                $error = lang('store_goods_album_climit');
                exit(json_encode(array('error' => $error)));
            }
        }

用公共方法upload_albumpic上传图片文件,如果是本地存储则用公共方法create_albumpic_thumb同时生成2404801280规格的压缩图

            //本地图片保存
            $file_object = request()->file($file_name);
            $upload_path = BASE_UPLOAD_PATH . DS . $upload_path;
            $info = $file_object->rule('uniqid')->validate(['ext' => ALLOW_IMG_EXT])->move($upload_path, $save_name);
            if ($info) {
                $img_path = $upload_path . '/' . $info->getFilename();
                create_albumpic_thumb($upload_path,$info->getFilename());
                return array('code' => '10000', 'message' => '', 'result' => $img_path);
            }
            else {
                $error = $file_object->getError();
                $data['code'] = '10001';
                $data['message'] = $error;
                $data['result'] = $_FILES[$file_name]['name'];
                return $data;
            }

 

第三步save_goods操作保存商品数据

将商品公共信息保存在goodscommon表,将商品属性serialize序列化存储在goods_attr列中,商品规格信息保存在goods



上一篇:卖家

下一篇:实物订单模块