search

Home  >  Q&A  >  body text

Ask about php tp5 processing the result set of select

$wamResult = WpAdsupplierMerchant::where('cate_id',$cateId)->field('merchant_id')->select();//All store ids

Hello, I would like to The IDs of all collections are stored in a variable, for example: $ids = [12,21,23,32,11];

Now the result of $wamResult is:

[data: protected] => Array

(

[merchant_id] => 345

)

[origin:protected] => Array

(

[merchant_id] => 345

)

[relation:protected] => ; Array

(

)

The current problem is I don’t know how to deal with $wamResult,

骄阳似火骄阳似火2013 days ago1247

reply all(2)I'll reply

  • 骄阳似火

    骄阳似火2019-06-27 10:59:07

    is like this, for example: $ids = "12,21,23,32,11";

    reply
    0
  • 骄阳似火

    Got it, using this method to query is an array collection $wamResult = WpAdsupplierMerchant::where('cate_id',$cateId)->column('merchant_id');

    骄阳似火 · 2019-06-27 11:16:10
  • Cancelreply