StoreOrderCartInfo.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/12/26
  6. */
  7. namespace app\admin\model\order;
  8. use crmeb\basic\BaseModel;
  9. use crmeb\traits\ModelTrait;
  10. class StoreOrderCartInfo extends BaseModel
  11. {
  12. /**
  13. * 模型名称
  14. * @var string
  15. */
  16. protected $name = 'store_order_cart_info';
  17. use ModelTrait;
  18. /** 获取订单产品列表
  19. * @param $oid
  20. * @return array
  21. */
  22. public static function getProductNameList($oid)
  23. {
  24. $cartInfo = self::where('oid',$oid)->select();
  25. $goodsName = [];
  26. foreach ($cartInfo as $cart){
  27. if(isset($cart['cart_info']['productInfo'])){
  28. $suk = isset($cart['cart_info']['productInfo']['attrInfo']) ? '('.$cart['cart_info']['productInfo']['attrInfo']['suk'].')' : '';
  29. $goodsName[] = $cart['cart_info']['productInfo']['store_name'].$suk;
  30. }else{
  31. $goodsName[] = '';
  32. }
  33. }
  34. return $goodsName;
  35. }
  36. }