Fecmall

第 2 位会员

会员
个人信息
  • 加入于 2017-05-31 17:38:45
  • 城市 Qingdao
  • GitHub https://github.com/fecshop
  • 最后登录时间 12天前
  • 签名 净化自己,潜心编码
个人简介
Terry,Fecmall开源产品作者,12年电商经验一线程序员开发者,擅长规划产品,架构设计。
个人成就
  • 发表文章次数 744
  • 发布回复次数 5760
  • 个人主页浏览次数 683
yii 对象数组 如何取值8年前

$model->username , 你不是已经写出来了吗?

打开菜单时会覆盖上一个菜单,而不是在打开一个tab页8年前

@xi_qing #5楼 嗯,是这个意思,如果两个页面的div标签全部不一样,不存在冲突,就没有问题了。

打开菜单时会覆盖上一个菜单,而不是在打开一个tab页8年前

@xi_qing [#2楼](#comment2) 譬如:

后台对page页的列表的展示部分: https://github.com/fecshop/yii2_fecshop/blob/master/app/appadmin/modules/Cms/block/article/Index.php

大致只需要重写这两个方法就出来列表的

 public function getSearchArr()
    {
        $data = [
            [    // selecit的Int 类型
                'type'=>'select',
                'title'=>'状态',
                'name'=>'status',
                'columns_type' =>'int',  // int使用标准匹配, string使用模糊查询
                'value'=> [                    // select 类型的值
                    1=>'激活',
                    2=>'关闭',
                ],
            ],
            [    // 字符串类型
                'type'=>'inputtext',
                'title'=>'标题',
                'name'=>'title',
                'columns_type' =>'string',
            ],
            [    // 时间区间类型搜索
                'type'=>'inputdatefilter',
                'name'=> 'created_at',
                'columns_type' =>'int',
                'value'=>[
                    'gte'=>'用户创建时间开始',
                    'lt' =>'用户创建时间结束',
                ],
            ],
        ];
        return $data;
    }
    /**
     * config function ,return table columns config.
     */
    public function getTableFieldArr()
    {
        $table_th_bar = [
            [
                'orderField'    => $this->_primaryKey,
                'label'            => 'ID',
                'width'            => '50',
                'align'        => 'center',
            ],
            [
                'orderField'    => 'title',
                'label'            => '标题',
                'width'            => '50',
                'align'        => 'left',
                'lang'            => true,
            ],
            [
                'orderField'    => 'created_user_id',
                'label'            => '创建人',
                'width'            => '110',
                'align'        => 'center',
            ],
            [
                'orderField'    => 'created_at',
                'label'            => '创建时间',
                'width'            => '110',
                'align'        => 'center',
                'convert'        => ['int' => 'datetime'],
            ],
            [
                'orderField'    => 'updated_at',
                'label'            => '更新时间',
                'width'            => '110',
                'align'        => 'center',
                'convert'        => ['int' => 'datetime'],
            ],
        ];
        return $table_th_bar;
    }

这种方式也是参考的magento的封装。不过magento的封装,封的更厉害,导致灵活性不高。当然,我这种封装方式,灵活性方面也有点欠缺。

打开菜单时会覆盖上一个菜单,而不是在打开一个tab页8年前

@xi_qing #2楼 这样不行的,回存在问题, 由于fecshop的admin部分,为了更快的增删改查,这个部分是封装的,写一个增删改查带有排序搜索分页功能就比较快。 这样,很多tab的html部分的class和div结构会很类似,因此 ,会存在执行冲突,tab2的js会操作tab1的html,譬如一些ajax操作需要修改内容。

因此不要这样改。

打开菜单时会覆盖上一个菜单,而不是在打开一个tab页8年前

你这样说,你认为别人能看明白吗?描述完成,想一想,是否别人能清楚你的意思、

mac shell 按键问题8年前

@luopeihai #3楼 下载个xshell,用这个去连接,就和连接远程主机一样的原理。

哈哈,我是第一个新注册的用户?8年前

@chenmy #5楼

哈哈,我才是第一个。

forecho是除管理员的第一位

composer 报错8年前

是否严格按照步骤?

composer global require "fxp/composer-asset-plugin:^1.2.0"
composer create-project fancyecommerce/fecshop-app-advanced  fecshop 1.0.2.9
cd fecshop
composer update    
./init

如果按照这个步骤,还是报错,应该是网络问题。

您可以使用中国镜像:https://pkg.phpcomposer.com/

composer 默认地址改为中国镜像地址,以及中国镜像地址还原成默认地址

mac shell 按键问题8年前

是不是输入法的问题,只能自己搜索解决下了,没有用过mac

fecshop 安装mongodb-migrate 报错8年前

这个问题,在php5中会出现,在php7中安装不会出现,应该是一个bug,已经提交给Yii

https://github.com/yiisoft/yii2-mongodb/commit/6e149bb55f801f7e44e0e1f71a98a2a7c3766fe7

fecshop 安装mongodb-migrate 报错8年前

尝试了一下,的确是报错,问题出在yii2 mongodb扩展存在问题

原因:vendor/yiisoft/yii2-mongodb/console/controllers/MigrateController.php

 /**
     * Creates a new migration instance.
     * @param string $class the migration class name
     * @return \yii\mongodb\Migration the migration instance
     */
    protected function createMigration($class)
    {
        $class = trim($class, '\\');
        if (strpos($class, '\\') === false) {
            $file = $this->migrationPath . DIRECTORY_SEPARATOR . $class . '.php';
            require_once($file);
        }

        return new $class(['db' => $this->db]);
    }

$this->migrationPath 输出是一个数组: var_dump( $this->migrationPath);

array(1) {
  [0]=>
  string(62) "/www/web/drop/vendor/fancyecommerce/fecshop/migrations/mongodb"
}

修改代码如下:

 protected function createMigration($class)
    {
        $class = trim($class, '\\');
        if (strpos($class, '\\') === false) {
            
            $file = $this->migrationPath[0] . DIRECTORY_SEPARATOR . $class . '.php';
            require_once($file);
        }

        return new $class(['db' => $this->db]);
    }

即可安装成功:

[root@localhost drop]# ./yii mongodb-migrate  --interactive=0 --migrationPath=@fecshop/migrations/mongodb
Yii Migration Tool (based on Yii v2.0.12)

Total 1 new migration to be applied:
	m170228_072455_fecshop_tables

*** applying m170228_072455_fecshop_tables
*** applied m170228_072455_fecshop_tables (time: 0.172s)


1 migration was applied.

Migrated up successfully.
[root@localhost drop]# 

这个是官方扩展的bug,已经提交给yii issues,地址如下:

https://github.com/yiisoft/yii2-mongodb/issues/214

Linux集成环境(如wdcp)安装Fecshop遇到的问题?8年前

嗯 , /usr/local/php 是你的php的安装路径,一般手动编译的都在这个路径下面

如果是yum安装的php,就在别的路径,您只需要将 安装过程中出现的 /usr/local/php 替换成您的php路径即可。

如果不熟悉linux下面的环境配置,还是按照文档一步一步来操作,如果是老司机就无所谓了。怎么都能搞定。

360浏览器 后台点击菜单不在框架里,在新标签弹出没有样式8年前

@imnian #4楼 你网速不好,没有加载完文件,这个后台框架是ajax框架

mac http://rock.fecshoptest.com/访问不了8年前
  1. 确定vagrant是否启动成功?
  2. 如果启动成功,那么shell连接进去看看,查看nginx php mysql等是否启动
  3. 如果都启动成功了,还是不行,关掉iptables,
  4. 如果还是不行,你自己搜索解决吧,估计哪里搞错了,回去仔细看文档。
mac http://rock.fecshoptest.com/访问不了8年前

另外,本地测试可以关闭 iptables service iptables stop

mac http://rock.fecshoptest.com/访问不了8年前

你这里的配置还是用80吧

vagrantfile文件配置,您用下面的吧

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "centos-6.6-x86_64"
  
  config.vm.hostname = "dev"
  config.ssh.username = "root"
  config.ssh.password = "123456"
  config.ssh.insert_key = "true"
  config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
  config.ssh.forward_agent = true
  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
   config.vm.network "forwarded_port", guest: 80, host: 80

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  ## config.vm.network "private_network", ip: "192.168.10.12"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  ## config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"
    config.vm.synced_folder "D:\\linux\\fecshop", "/www/web/develop/fecshop_win"
  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    # vb.gui = true
    vb.name = "dev"
    # Customize the amount of memory on the VM:
    vb.memory = "2048"
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

其中config.vm.synced_folder "D:\\linux\\fecshop", "/www/web/develop/fecshop_win" , 该配置的作用为将windows的 D:\\linux\\fecshop 挂载到vagrant虚拟的linux的/www/web/develop/fecshop_win

您还是都用80端口吧,不然要更改nginx配置。

vagrant虚拟机怎么把项目文件共享到Windows主机本地8年前

@shen1228 [[#15楼](#comment15)](#comment15) @shen1228 [[#15楼](#comment15)](#comment15)

将vagrantfile文件中的

config.vm.network "private_network", ip: "192.168.10.12"

config.vm.network "public_network"

前面加#号注释掉,vagrant reload重启试试。

要看报错信息,先自己尝试解决。

我要做APP端商城的开发,求相关资源8年前

@fecandy [#4楼](#comment4) 目前人手不够,那些太遥远,无法回答,得养家生活,得吃喝拉撒,fecshop无任何盈利和投资。

Your Site Analytics