随笔分类 - Symfony框架
摘要:order 表中 /** * @ORM\OneToOne(targetEntity="SnatchTreasure") */ private $snatchTreasure; 在snatchTreasure表中有 /** * @ORM\OneToOne(targetEntity="OrderRecord", mappedBy="snatchTreasure")//注意这两处书写要一致才...
阅读全文
摘要:在userTreasure表中增加组合唯一键:snatch_treasure_lottery_number_unique 它为:snatch_treasure_id,lottery_number的组合
阅读全文
摘要:symfony有很多有意思的traits比如timestamp等。 使用方法: 然后在entity中使用: 在声名的地方添加:use Gedmo\Timestampable\Traits\TimestampableEntity; 在类比如Entity的内部使用:use TimestampableEn
阅读全文
摘要:在应用中有的时候难免要进行一些删除记录操作,但是这个时候如果有外键关联,并且不想把关联数据删除掉就很麻烦。 解决方法是可以采用symfony自带的软删除功能 官方文档在:https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBund
阅读全文
摘要:如果需要跳转到的页面是一个静态页面且不需要经过controller的情况 anchor_list: path: /game/anchor/list defaults: _controller: FrameworkBundle:Template:template template: TronWebBu
阅读全文
摘要:使用dql进行联表查询 public function getChampionQuizzes($gameCategoryId) { $dql = "SELECT q FROM TronWebBundle:Quiz q LEFT JOIN q.le...
阅读全文
摘要:在twig的html 标签中 DOTA冠军玩法焦点图 2. 在ajax中的url $.ajax({ url: "{{ path('quiz_update_head_count', {'id': entity.id }) }}", ...
阅读全文
摘要:修改访问权限 sudo chmod -R 777 app/logs/ app/cache/
阅读全文
摘要:在app/config/services.yml中添加 tron.send_weixin_message: class: Tron\LolBundle\Common\SendWeiXinMessage //这一行代表要将service插入的位置 arguments: ["...
阅读全文
摘要:在verdor/doctrine/orm/lib/Doctrine/ORM目录下
阅读全文
摘要:在command文件夹下建立一个含有任务的PHP文件,后缀为Command。写一个类继承ContainerAwareCommand在命令行中执行php app/console TronWebBundle:update:userInfoAboutLol即可执行操作
阅读全文
摘要:连接VPN通过SSH连接到服务器将git 当前分支切换到需要的GIT分支进入/srv/www/dotacai.com 并运行sudo ./deploy
阅读全文
摘要:在数据库中加一个字段,见给数据库加字段部分的介绍在ALL的TWIG中理性按键的类型,来增加排序功能如下: 状态正序 | 倒序增加JS来触发这个事件 $(document).ready(function() { $('.asc,.desc').css('cursor', 'poin...
阅读全文
摘要:如果采用migration bundle则命令不用 --force命令 参考文档:http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
阅读全文