1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\api\service;
- use app\common\models\Payment as PaymentModel;
- class Payment extends Service {
-
- public static function getList($data){
- $type = $data["type"]??"h5";
- $payType = $data["pay_type"]??"order";
- $in = [];
- $in[] = $type;
- if($payType == "order"){
- $in[] = "common";
- }
- $res = PaymentModel::where("status","0")->where("type","in",$in)->order("sort","DESC")->select()->toArray();
- $array = [];
- $style = [
- "wechat"=>["css"=>"iconfont iconweixin","text"=>'\ue673'],
- "alipay"=>["css"=>"iconfont iconumidd17","text"=>'\ue603'],
- "balance"=>["css"=>"iconfont iconxinbaniconshangchuan-","text"=>'\ue608']
- ];
- foreach($res as $value){
- $id = explode("-",$value["code"]);
- $array[] = [
- "name"=>$value["alias_name"],
- "id"=>$id[0],
- "class"=>$style[$id[0]]["css"],
- "text"=>$style[$id[0]]["text"]
- ];
- }
- return $array;
- }
- }
|