public function actionInfo() { $this->checkLogin(); $id = $_POST['id']; $payType = PayType::model()->findByPk((int) $id); if ($payType) { echo CJSON::encode($payType); } else { echo 'id = ' . $id; } }
public static function getShopDetail($user_id, $shop_id) { $host_info = Yii::app()->request->hostInfo; $criteria = new CDbCriteria(); $record_tpes = CarWashType::model()->findAll($criteria); $criteria = new CDbCriteria(); $record_pays = PayType::model()->findAll($criteria); $criteria = new CDbCriteria(); $criteria->condition = "shop_id='" . $shop_id . "'"; $record_shp = ShopInfo::model()->find($criteria); if ($record_tpes == null || $record_pays == null || $record_shp == null) { $ret_json = array("status" => 1, "message" => "未查询到商家信息!", "data" => array()); return $ret_json; } $shop_wash_type = $record_shp->shop_wash_type; $shop_wash_type_l = explode('|', $shop_wash_type); $washing = array(); foreach ($record_tpes as $record_tpe) { if (in_array($record_tpe->service_id, $shop_wash_type_l)) { $washing[] = array("id" => $record_tpe->service_id, "name" => $record_tpe->service_name); } } $shop_payment = $record_shp->shop_payment; $shop_payment_l = explode('|', $shop_payment); $paytype = array(); foreach ($record_pays as $record_pay) { if (in_array($record_pay->id, $shop_payment_l)) { $paytype[] = array("type" => $record_pay->type, "icon_url" => trim($host_info, '/') . "/" . $record_pay->icon_url); } } $shop_services = $record_shp->shop_services; $shop_services_l = explode('|', $shop_services); $shop_fans = $record_shp->shop_fans; $shop_fans_l = explode('|', $shop_fans); if (in_array($user_id, $shop_fans_l)) { $wethercollect = 1; } else { $wethercollect = 0; } $shop_info = array("imgUrl" => trim($host_info, '/') . "/" . $record_shp->shop_image_url, "shop_name" => $record_shp->shop_name, "star" => $record_shp->shop_star, "telephone" => $record_shp->shop_phone, "business_hours" => array("start" => $record_shp->shop_start_time, "end" => $record_shp->shop_end_time), "wethercollect" => $wethercollect, "paytype" => $paytype, "aboutus" => $record_shp->shop_about_us, "services" => $shop_services_l, "washing" => $washing); $ret_json = array("status" => 0, "message" => "获取商家列表成功!", "data" => array($shop_info)); return $ret_json; }
public function actionPayType() { $payTypes = PayType::model()->findAll(); $this->renderPartial('//Dialog/PayType', array('payTypes' => $payTypes)); }