yyf

yyf

如果努力后没有结果,那是因为只是你觉得你已经努力了

  • 财富值1215
  • 威望值50
  • 总积分1935

个人信息

  • 使用同一个数据库。。。。

  • 回复了 的说说
    上海下雨
    天气应该要变冷了
  • 赞了说说
    上海下雨
  • 2017-10-11 已签到
    连续签到1天,获得了5个金钱
  • 回答了问题 yii2 导出pdf

    解决了改问题,是因为当文本比较长的时候,客户端在输入的时候使用了回车换行,所以导出的pdf不使用自动换行,会根据输入的换行符换行,造成字体很小,将文本中的换行符替换掉就可以了。 preg_replace('/\s/', '
    ', $info);

  • 你使用了asArray()了吧,这个方法把查出的所有数据都返回了string类型,
    你可以使用ArrayHelper::toArray(AR数据对象)

  • 赞了回答

    在你的apache 里面增加配置文件,将网站根目录指向到你的web 目录,重启apache即可

  • 赞了回答

    源码参考yii\db\baseActiveRecord

    protected function updateInternal($attributes = null)
        {
            if (!$this->beforeSave(false)) {
                return false;
            }
            $values = $this->getDirtyAttributes($attributes);
            if (empty($values)) {
                $this->afterSave(false, $values);
                return 0;
            }
            $condition = $this->getOldPrimaryKey(true);
            $lock = $this->optimisticLock();
            if ($lock !== null) {
                $values[$lock] = $this->$lock + 1;
                $condition[$lock] = $this->$lock;
            }
            // We do not check the return value of updateAll() because it's possible
            // that the UPDATE statement doesn't change anything and thus returns 0.
            $rows = static::updateAll($values, $condition);
    
            if ($lock !== null && !$rows) {
                throw new StaleObjectException('The object being updated is outdated.');
            }
    
            if (isset($values[$lock])) {
                $this->$lock = $values[$lock];
            }
    
            $changedAttributes = [];
            foreach ($values as $name => $value) {
                $changedAttributes[$name] = isset($this->_oldAttributes[$name]) ? $this->_oldAttributes[$name] : null;
                $this->_oldAttributes[$name] = $value;
            }
            $this->afterSave(false, $changedAttributes);
    
            return $rows;
        }
    

    $insert 表示是否是插入,changedAttributes显而易见可以知道,更新的时候被改变的attribute

  • 发表了说说
    开始上班了
  • 2017-10-09 已签到
    连续签到1天,获得了5个金钱
经理 等级规则
1935/2000
资料完整度
60/100
用户活跃度
0/100

Ta的关注

5

Ta的粉丝

6

Ta的访客

30