get_attr_data.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {__NOLAYOUT__}
  2. <div class="layui-form-item">
  3. <label class="layui-form-label">设置规格:</label>
  4. <div class="layui-input-block">
  5. <div>
  6. <button class="layui-btn layui-set-btn-spec">设置商品属性</button>
  7. <button class="layui-btn layui-clear-btn-spec layui-btn-primary">清空商品属性</button>
  8. </div>
  9. </div>
  10. </div>
  11. <table class="layui-table">
  12. <colgroup>
  13. {if !empty($head)}
  14. {volist name="head" id="val"}
  15. <col>
  16. {/volist}
  17. {/if}
  18. <col width="120">
  19. <col width="120">
  20. <col width="120">
  21. <col width="120">
  22. <col width="120">
  23. </colgroup>
  24. <thead>
  25. <tr>
  26. {if !empty($head)}
  27. {volist name="head" id="val"}
  28. <th>{$val.name}</th>
  29. {/volist}
  30. {/if}
  31. <th>销售价格</th>
  32. <th>市场价格</th>
  33. <th>成本价格</th>
  34. <th>重量(克)</th>
  35. <th>库存</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <?php if(!empty($data)) : foreach($data as $val) : $spec_key = $spec_data = ""; ?>
  40. <tr>
  41. <?php foreach($val as $item) : $param = explode(";;;",$item); ?>
  42. <td>
  43. <?php
  44. $spec_key .= $param[2] . ':' . $param[3].',';
  45. $spec_data .= $param[0] . ':' . $param[1].',';
  46. echo $param[1];
  47. ?>
  48. </td>
  49. <?php endforeach; ?>
  50. <?php $spec_key = trim($spec_key,','); ?>
  51. <td>
  52. <input type="hidden" name="spec_list_key[]" value="<?php echo $spec_key; ?>">
  53. <input type="hidden" name="spec_list_data[]" value="<?php echo trim($spec_data,','); ?>">
  54. <input type="text" name="sell_price[]" value="<?php echo isset($goods[$spec_key]['sell_price']) ? $goods[$spec_key]['sell_price'] :''; ?>" placeholder="销售价格" autocomplete="off" class="layui-input">
  55. </td>
  56. <td>
  57. <input type="text" name="market_price[]" value="<?php echo isset($goods[$spec_key]['market_price']) ? $goods[$spec_key]['market_price'] : ''; ?>" placeholder="市场价格" autocomplete="off" class="layui-input">
  58. </td>
  59. <td>
  60. <input type="text" name="cost_price[]" value="<?php echo isset($goods[$spec_key]['cost_price']) ? $goods[$spec_key]['cost_price'] : ''; ?>" placeholder="成本价格" autocomplete="off" class="layui-input">
  61. </td>
  62. <td>
  63. <input type="text" name="goods_weight[]" value="<?php echo isset($goods[$spec_key]['goods_weight']) ? $goods[$spec_key]['goods_weight'] : ''; ?>" placeholder="重量(克)" autocomplete="off" class="layui-input">
  64. </td>
  65. <td>
  66. <input type="text" name="store_nums[]" value="<?php echo isset($goods[$spec_key]['store_nums']) ? $goods[$spec_key]['store_nums'] : ''; ?>" placeholder="库存" autocomplete="off" class="layui-input">
  67. </td>
  68. </tr>
  69. <?php endforeach; endif; ?>
  70. </tbody>
  71. </table>