本文整理汇总了PHP中Help::ArrayToString方法的典型用法代码示例。如果您正苦于以下问题:PHP Help::ArrayToString方法的具体用法?PHP Help::ArrayToString怎么用?PHP Help::ArrayToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Help
的用法示例。
在下文中一共展示了Help::ArrayToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ItemParams
/**
* 订单商品表提交数据
*
* @param $order_id
* @param $order_item
* @return bool
*/
public function ItemParams($order_id, $order_item)
{
$product_ids = Help::ArrayToString($order_item, 'product_id');
if (!$product_ids) {
return false;
}
$Spec = new ModelSpec();
$product_spec = $Spec->ProductSpec($product_ids);
foreach ($order_item as $v) {
$object = array('order_id' => $order_id, 'obj_type' => 'goods', 'obj_alias' => '商品区块', 'goods_id' => $v['goods_id'], 'bn' => $v['bn'], 'name' => $v['name'], 'price' => $v['price'], 'amount' => 0, 'quantity' => $v['quantity'], 'weight' => 0, 'score' => 0);
$params[$v['product_id']]['object'] = $object;
$spec['product_attr'] = isset($product_spec[$v['product_id']]) ? $product_spec[$v['product_id']] : '';
!empty($spec['product_attr']) ? $addon = serialize($spec) : ($addon = '');
$item = array('order_id' => $order_id, 'obj_id' => 0, 'product_id' => $v['product_id'], 'goods_id' => $v['goods_id'], 'type_id' => $v['type_id'], 'bn' => $v['bn'], 'name' => $v['name'], 'cost' => $v['cost'], 'price' => $v['price'], 'g_price' => $v['price'], 'amount' => $v['price'] * $v['quantity'], 'score' => 0, 'weight' => 0, 'nums' => $v['quantity'], 'sendnum' => 0, 'addon' => $addon, 'item_type' => 'product');
$params[$v['product_id']]['item'] = $item;
}
return $params;
}