Fecmall

第 2 位会员

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

请详细描述问题!!!!!!!!!!!! 无脑发帖

fecshop整合微信支付的一个实现方法(能正常支付成功,但没有经过生产环境的测试不能保证安全性,仅供参考,欢迎指点改正)7年前

@alex #7楼 我今天细看了你的代码,存在问题,你的支付状态不是通过IPN更改订单状态, 而是通过js去获取,如果用户刷出来二维码,然后,用微信刷进行支付,在支付成功之前,关掉浏览器, 然后进行微信支付,fecshop就无法更改订单状态了。

Mongodb搜索报错:Sort operation used more than the maximum 33554432 bytes of RAM7年前

上面我是将默认的32mb,改成了320MB。这个看自己的机器的内存进行设置。

Mongodb搜索报错:Sort operation used more than the maximum 33554432 bytes of RAM7年前

报错信息为: Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.

根据文档: https://docs.mongodb.com/manual/reference/command/getParameter/

可以设置一下参数:internalQueryExecMaxBlockingSortBytes

mongodb 3.x有效

因此,可以在 /etc/mongod.conf 中添加参数,然后重启mongodb即可

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /data/var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: /data/var/lib/mongo
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Listen to local interface only, comment to listen on all interfaces.
setParameter:
  internalQueryExecMaxBlockingSortBytes: 335544320

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options

#auditLog:

#snmp:

上面是加完后,我的mongodb的配置

两个布局 如何在其中一个布局中 加载asset时删除某个css或者js?7年前

你写一个新的Asset文件来替代 AppAsset,main.php 还是用AppAsset ,你的main_2.php 使用你新建的App2Asset,里面完全自定义。

两个布局 如何在其中一个布局中 加载asset时删除某个css或者js?7年前

@jingjim #3楼 你重写的方法中,用到那个,你就引入那个,说的这么详细了,还不明白,我也无能为力了,自己琢磨吧

两个布局 如何在其中一个布局中 加载asset时删除某个css或者js?7年前

设置layout文件

在yii/base/controller.php文件可以看到:

public function findLayoutFile($view)
    {
        $module = $this->module;
        if (is_string($this->layout)) {
            $layout = $this->layout;
        } elseif ($this->layout === null) {
            while ($module !== null && $module->layout === null) {
                $module = $module->module;
            }
            if ($module !== null && is_string($module->layout)) {
                $layout = $module->layout;
            }
        }

        if (!isset($layout)) {
            return false;
        }

        if (strncmp($layout, '@', 1) === 0) {
            $file = Yii::getAlias($layout);
        } elseif (strncmp($layout, '/', 1) === 0) {
            $file = Yii::$app->getLayoutPath() . DIRECTORY_SEPARATOR . substr($layout, 1);
        } else {
            $file = $module->getLayoutPath() . DIRECTORY_SEPARATOR . $layout;
        }

        if (pathinfo($file, PATHINFO_EXTENSION) !== '') {
            return $file;
        }
        $path = $file . '.' . $view->defaultExtension;
        if ($view->defaultExtension !== 'php' && !is_file($path)) {
            $path = $file . '.php';
        }

        return $path;
    }

通过if (is_string($this->layout)) { 可以看到,可以通过在controller中设置类变量$layout 来设置layout文件。

两个布局 如何在其中一个布局中 加载asset时删除某个css或者js?7年前

看懂了上面的原理,你下面做的是,复制layouts/main.php 成一个新的layout文件,譬如main_2.php 然后按照上面的原理进行修改

然后,你需要在controller中设置当前的layout文件为main_2.php

两个布局 如何在其中一个布局中 加载asset时删除某个css或者js?7年前

您好 打开/backend/views/layouts/main.php 你会看到如下内容:

<?php

/* @var $this \yii\web\View */
/* @var $content string */

use backend\assets\AppAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use common\widgets\Alert;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">

注册css和js是 类 backend\assets\AppAsset 这个asset类完成的,那么,打开这个类

<?php

namespace backend\assets;

use yii\web\AssetBundle;

/**
 * Main backend application asset bundle.
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.css',
    ];
    public $js = [
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];
}

你如果想去掉 'css/site.css' ,这个css ,直接去掉就可以了。

当然,可能也在于依赖的assets里面。譬如是

'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset'

里面的某一个,这个是Yii的,你可以新建一个Assets,然后重写里面的方法,把想去掉的去掉,然后$depends里面填写你重写的Assets即可。

7年前

http://www.fecshop.com/topic/290

这个帖子不是你之前问的吗?都回帖一次了,也是rewritemap的问题

7年前

1.appadmin的东西,最好写到appadmin/config/YiiRewriteMap.php

也就是文件:https://github.com/fecshop/yii2_fecshop_app_advanced/blob/master/appadmin/config/YiiRewriteMap.php

2.里面的内容你少了一个 '\'

应该是:

return [
    /**
     * \fecshop\models\mongodb\Category 为原来的类
     * \appfront\local\local_models\mongodb\Category 为重写后的类
     * 重写后的类可以集成原来的类。
     */
    '\fecshop\app\appadmin\modules\Catalog\block\productinfo\Manageredit' => '\appadmin\local\local_modules\Catalog\block\productinfo\Manageredit'
];

appadmin\local\local_modules\Catalog\block\productinfo\Manageredit前面需要加一个'\'

产品详情页接口,如何根据sku切换商品7年前

noactive代表产品是不存在的,因此没有id

active代表此属性的产品存在

current 代表当前产品的属性值

appadmin 一处代码错误7年前

添加属性后,在后台新建产品,切换到相应的属性组,就可以看到添加的属性了

appadmin 一处代码错误7年前

如果你需要加描述属性,你可以在属性组里面加属性,

参考文档:http://www.fecshop.com/doc/fecshop-guide/instructions/cn-1.0/guide-fecshop_product.html

文档的:2、general_attr(普通属性)

custom option 是放到前台页面,让用户选择的属性。

你的需求可以这样加:

'general_attr' => [  
	# 这是input type='text' 的类型
	'my_remark' => [
		'dbtype'=> 'String',
		'label'=>'我的备注',
		'name'=>'my_remark',
		'display'=>[
			'type' => 'inputString',   # 字符串格式的属性
		],
		'require' => 0,
	],
	# 这是input type='email' 的类型
	'my_email' =>[
		'dbtype'=> 'String',
		'label'=>'我的邮箱',
		'name'=>'my_email',
		'require' => 0,
		'display'=>[
			'type' => 'inputEmail',		# 字符串格式的属性(email格式验证)
		],
	],
appadmin 一处代码错误7年前

@dionyang #3楼 input输入框这种,还有radio,textarea,在magento中都是有的,但,就截止到目前,我没有遇到过要输入input框方面的需求,我也就没有加这个。

你有这方面的需求吗?可以说一下,具体是什么样子的需求,必须用input框。

订单中加一个订单备注倒是可以的。

appadmin 一处代码错误7年前

已经提交,过段时间发个版本

appadmin 一处代码错误7年前

多谢您,我改一下,多谢!

Your Site Analytics