private function itemDetailGetItWithOrder($query, $missionSt) { $rightNowUserId = Yii::$app->user->identity->XH_ID; $usertb = new UserTb(); $status = $usertb->getAuthority($rightNowUserId); $Lev1 = ''; $Lev2 = ''; foreach ($query as $value) { switch ($value['status']) { case '1': $Lev1 .= '<div class=\\"Thedetail\\" onclick=\\"detailDet(' . $value['ItemDetail_Id'] . ')\\" draggable=\\"true\\" id=\\"Detail' . $value['ItemDetail_Id'] . '\\" data-id=\\"' . $value['ItemDetail_Id'] . '\\" ondragstart=\\"drag(event)\\"><p class=\\"Thedetail_p\\">' . $value['discribe'] . '</p></div>'; break; case '2': $Lev2 .= '<div class=\\"Thedetail\\" onclick=\\"detailDet(' . $value['ItemDetail_Id'] . ')\\" draggable=\\"true\\" id=\\"Detail' . $value['ItemDetail_Id'] . '\\" data-id=\\"' . $value['ItemDetail_Id'] . '\\" ondragstart=\\"drag(event)\\"><p class=\\"Thedetail_p\\">' . $value['discribe'] . '</p></div>'; break; } } return '{"success":true, "authority":"' . $status . '","msg1":"' . $Lev1 . '", "msg2":"' . $Lev2 . '","msg3":"' . $query[0]['item_id'] . '","missionSt":"' . $missionSt . '"}'; }
public function actionGetitems() { $msg = ''; $item = new Items(); $itemPerson = new Itempersons(); $rightNowUserId = Yii::$app->user->identity->XH_ID; $usertb = new UserTb(); $status = $usertb->getAuthority($rightNowUserId); $name = $usertb->getName($rightNowUserId); $result = $item->searchAllItems(2); $result2 = $item->searchOtherItems(2); if ($result2 || $result) { foreach ($result as $value) { $msg .= '<div onclick=\\"detailShow(' . $value['Item_Id'] . ')\\" id=\\"' . $value['Item_Id'] . '\\" class=\\"item_show\\" style=\\"background-image: url(images/itemImg.jpeg);\\"><h3 class=\\"item_showtit\\">' . $value['Item_Name'] . '</h3></div>'; } foreach ($result2 as $value) { $msg .= '<div onclick=\\"detailShow(' . $value['Item_Id'] . ')\\" id=\\"' . $value['Item_Id'] . '\\" class=\\"item_show\\" style=\\"background-image: url(images/itemImg.jpeg);\\"><h3 class=\\"item_showtit\\">' . $value['Item_Name'] . '</h3></div>'; } echo '{"success":true,"msg": "' . $msg . '","msg1":"' . $status . '","name":"' . $name . '"}'; } else { echo '{"success":false,"msg1":"' . $status . '","name":"' . $name . '"}'; } }