thinkphp 视图模型使用分析
2015-08-10 21:02 freefei 阅读(211) 评论(0) 编辑 收藏 举报<?php /** * 视图模型 * */ class ViewBatchModel extends ViewModel{ public $viewFields = array( 'Jinxiao_batch'=>array('id','orderid','proid','subid','time','productdate','intobatch','num'), 'Jinxiao_product'=>array('id'=>'productID','default2'=>'day','default1'=>'aaa','_on'=>'Jinxiao_batch.proid=Jinxiao_product.id and Jinxiao_batch.productdate+(Jinxiao_product.default2*3600*24)<unix_timestamp(now())'), ); }
计算时间天, 用到mysql数据库时间戳 函数 unix_timestamp(now())