1. 程式人生 > >thinkphp 子查詢

thinkphp 子查詢

ply thinkphp uil res ken app tab pre build

$subQuery = M("zstar_apply_goods")
    ->join("LEFT JOIN shop_products ON zstar_apply_goods.ShopToken = shop_products.ShopToken")
    ->where($where)
    ->field("zstar_apply_goods.ShopToken")
    ->group("zstar_apply_goods.ShopToken")
    ->buildSql();
$result = M("zstar_apply_goods")->table($subQuery
. ‘ a‘)->count();

thinkphp 子查詢