This article describes the content of the Tp5-page class in the each function, has a certain reference value, now share to everyone, the need for friends can refer to
$list = Db::name (' Merchant_order_detail ')->alias (' A ')->join (' Merchant_order b ', ' b.id = a.order_id ')->where ($WHERESTR)->field ($file)->order ($order)->paginate (Config::get (' List_rows '), False, [' page ' = = $page, ' Query ' = = $param])->each (function ($item, $key) { $item [' loglist '] = db::name (' Merchant_order_detail_log ')- >where ("order_detail_id=". $item [' id ']. "and Amount>0")->field (' Order_sn ')->select (); return $item; });
$list = Db::name (' Merchant_order ')->alias (' A ')->join (' merchant_member mm ', ' mm.id=a.member_id ', ' LEF T ')->where ($WHERESTR)->field ($file)->order ([' A.create_time ' = ' desc '])->paginate (config::get (' List_rows '), False, [' page ' = ' $page, ' query ' = + $param]) ->each (function ($item, $key) {if ($item [' pid '] = = 0) {$item [' Company_nam E '] = db::name (' Merchant ')->where ([' member_id ' = = $item [' member_id ']])->value (' company_name '); $item [' sub_company_name '] = db::name (' Merchant ')->where ([' member_id ' = = $item [' member_id ']])->value (' Sub_ Company_Name '); $item [' corporation '] = db::name (' Merchant ')->where ([' member_id ' = ' = ' $item [' member_id ']])->value (' Corporation '); } else {$item [' company_name '] = db::name (' Merchant ')->where ([' member_id '= = $item [' pid ']])->value (' company_name '); $item [' sub_company_name '] = db::name (' Merchant ')->where ([' member_id ' = + $item [' pid]])->value (' Sub_ Company_Name '); $item [' corporation '] = db::name (' Merchant ')->where ([' member_id ' = ' + $item [' pid ']])->value (' Corporation '); } return $item; });
$merchant _member_list = db::name (' Merchant_member ')->alias (' mm ')->join (' Merchant m ', ' m.member_id = Mm.id ', ' left ')->join (' Merchant_type mt ', ' m.merchant_type_id = Mt.id ', ' Left ')->where ($where)->field ($field) ->order ([' mm.is_lock ' = ' asc ', ' mm.create_time ' = ' desc '])-> ;p aginate (Config::get (' List_rows '), False, [' page ' = + $page, ' query ' + $param])-> ; each (function ($item, $key) {if ($item [' mt_pid ']== ' 0 ') { $item [' cate '] = ' level '; } else {$item [' cate '] = db::name (' Merchant_type ')->where ("id=". $item [' mt_pid ']) ->value (' name '); } return $item; });