StoreProductVirtualServices.php 629 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\services\product\sku;
  3. use app\dao\product\sku\StoreProductVirtualDao;
  4. use app\services\BaseServices;
  5. class StoreProductVirtualServices extends BaseServices
  6. {
  7. public function __construct(StoreProductVirtualDao $dao)
  8. {
  9. $this->dao = $dao;
  10. }
  11. public function getArr($unique, $product_id)
  12. {
  13. $res = $this->dao->getColumn(['attr_unique' => $unique, 'product_id' => $product_id], 'card_no,card_pwd');
  14. $data = [];
  15. foreach ($res as $item) {
  16. $data[] = ['key' => $item['card_no'], 'value' => $item['card_pwd']];
  17. }
  18. return $data;
  19. }
  20. }