本文整理汇总了PHP中CService::loadBackRefs方法的典型用法代码示例。如果您正苦于以下问题:PHP CService::loadBackRefs方法的具体用法?PHP CService::loadBackRefs怎么用?PHP CService::loadBackRefs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CService
的用法示例。
在下文中一共展示了CService::loadBackRefs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CService
/* $Id: do_delivery_aed.php 6067 2009-04-14 08:04:15Z phenxdesign $ */
/**
* @package Mediboard
* @subpackage soins
* @version $Revision: 6067 $
* @author SARL OpenXtrem
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
$service_id = CValue::get('service_id');
$date_min = CValue::get('date_min');
$date_max = CValue::get('date_max');
$service = new CService();
$orders = array();
if ($service->load($service_id) && $date_min && $date_max) {
$stocks = $service->loadBackRefs('product_stock_services');
if ($stocks) {
foreach ($stocks as $stock) {
$stock->loadRefsFwd();
$stock_group = CProductStockGroup::getFromCode($stock->_ref_product->code);
$target_quantity = $stock->order_threshold_optimum ? $stock->order_threshold_optimum : $stock->order_threshold_max;
if (CAppUI::conf('dPstock CProductStockService infinite_quantity') != 1) {
$effective_quantity = $stock->quantity;
$where = array('product_delivery.date_dispensation' => "BETWEEN '{$date_min} 00:00:00' AND '{$date_max} 23:59:59'", 'product_delivery.stock_id' => " = '{$stock_group->_id}'", 'product_delivery.stock_class' => " = '{$stock_group->_class}'", 'product.category_id' => " = '" . CAppUI::conf('dPmedicament CBcbProduitLivretTherapeutique product_category_id') . "'");
$ljoin = array('product_stock_group' => 'product_delivery.stock_id = product_stock_group.stock_id', 'product' => 'product.product_id = product_stock_group.product_id');
$delivery = new CProductDelivery();
$deliveries = $delivery->loadList($where, null, null, null, $ljoin);
foreach ($deliveries as $delivery) {
if ($delivery->order == 1 && $delivery->quantity > 0) {
$effective_quantity += $delivery->quantity;
}
示例2: intval
* @version $Revision: 6146 $
* @author SARL OpenXtrem
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
CCanDo::checkRead();
$service_id = CValue::get('service_id');
$start = intval(CValue::getOrSession('start', 0));
$letter = CValue::getOrSession("letter", "");
$only_service_stocks = CValue::getOrSession('only_service_stocks', 1);
$only_common = CValue::getOrSession('only_common');
$keywords = CValue::getOrSession('keywords');
$endowment_id = CValue::get('endowment_id');
$endowment_item_id = CValue::get('endowment_item_id');
$service = new CService();
$service->load($service_id);
$service->loadBackRefs("endowments");
if ($endowment_id === null && count($service->_back["endowments"])) {
$first = reset($service->_back["endowments"]);
$endowment_id = $first->_id;
}
// Calcul de date_max et date_min
$date_min = CValue::get('_date_min');
$date_max = CValue::get('_date_max');
if (!$date_min) {
$date_min = CValue::session('_date_delivrance_min', CMbDT::date("-1 DAY"));
}
if (!$date_max) {
$date_max = CValue::session('_date_delivrance_max', CMbDT::date());
}
CValue::setSession('_date_delivrance_min', $date_min);
CValue::setSession('_date_delivrance_max', $date_max);