예제 #1
0
 public function getGiftboxCategory()
 {
     return $this->hasOne(GiftboxCategory::className(), ['id' => 'category_id']);
 }
예제 #2
0
파일: yaoyiyao.php 프로젝트: noikiy/wowewe
        </li>
        <?php 
}
?>
    </ul>

        </div>
    </div>



    <script type="text/javascript">
    var SHAKE_THRESHOLD = 800;  
    var last_update = 0;
    var giftbox_categories = [<?php 
echo implode(',', \app\models\GiftboxCategory::getRemainingList());
?>
];
    var select_giftbox = 0;
    var x = y = z = last_x = last_y = last_z = 0;   

    function yaoyiyao() {  
        if (window.DeviceMotionEvent) {  
            window.addEventListener('devicemotion', deviceMotionHandler, false);  
        } else {  
            alert('not support mobile event');  
        }  
    }  
    
    function deviceMotionHandler(eventData) {  
        var acceleration = eventData.accelerationIncludingGravity;