public function actionDetails()
 {
     $session = new Sitesession();
     $user_id = $session->getUserId();
     $goods = $session->getGoods($user_id);
     $order_id = $session->getOrderId();
     $order = null;
     if (!empty($order_id)) {
         $order = Orders::findOne($order_id);
     }
     $user = null;
     if ($user_id) {
         //获取user_id用户信息
         /*$connection = \Yii::$app->db;
           $command = $connection->createCommand('SELECT * FROM customer WHERE id='.$user_id);
           $user = $command->queryOne();*/
         $user = Customer::findOne($user_id);
     }
     $count = 0;
     if (is_array($goods) && !empty($goods)) {
         /*$str = '';
           foreach ($goods as $key => $value) {
               if(empty($str)) {
                   $str = $str." ".$value;
               } else {
                   $str = $str.", ".$value;
               }
           }  */
         $count = count($goods);
         //获取goods
         $connection = \Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
             // 所有的查询都在主服务器上执行
             //$goods = $connection->createCommand('SELECT * FROM goods WHERE goods_id in ('.$str.')')->queryAll();
             $goods = Goods::findAll($goods);
             $transaction->commit();
         } catch (\Exception $e) {
             $transaction->rollBack();
             throw $e;
         }
     } else {
         $goods = false;
     }
     return $this->render('details', ['user' => $user, 'goods' => $goods, 'count' => $count, 'order' => $order]);
 }