本文整理汇总了PHP中Contract::table方法的典型用法代码示例。如果您正苦于以下问题:PHP Contract::table方法的具体用法?PHP Contract::table怎么用?PHP Contract::table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contract
的用法示例。
在下文中一共展示了Contract::table方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculate
function calculate($ctx)
{
$where = 1;
$where = "status = '" . Contract::STATUS_NEW . "'";
$real_data = RealData::get_cache();
$real_price = $real_data['amount'];
$sql = "SELECT name, strike_amount, ask_amount,";
$sql .= " ({$real_price}*(1+0.1)-strike_amount)/ask_amount as level_10,";
$sql .= " ({$real_price}*(1+0.15)-strike_amount)/ask_amount as level_15,";
$sql .= " ({$real_price}*(1+0.20)-strike_amount)/ask_amount as level_20";
$sql .= " FROM " . Contract::table();
$sql .= " WHERE status = '" . Contract::STATUS_NEW . "'";
$sql .= "order by level_20 desc, level_15 desc, level_10 desc";
$ctx->ds = Db::find($sql);
}