fix 推薦學習點功能Bug: 取得已學習展點SQL語法錯誤
This commit is contained in:
parent
3f2f66629f
commit
8620db35bc
@ -1399,26 +1399,27 @@ $app->group('/tokens', 'APIrequest', function () use ($app, $app_template) {
|
|||||||
else {
|
else {
|
||||||
$result_recommand_total = $recommandTotal;
|
$result_recommand_total = $recommandTotal;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 製作
|
// 製作
|
||||||
$output_targets = array();
|
$output_targets = array();
|
||||||
$output_target_ids = array();
|
$output_target_ids = array();
|
||||||
for($i=0; $i<$result_recommand_total; $i++) {
|
for($i=0; $i<$result_recommand_total; $i++) {
|
||||||
$target_id = $recommandResult[$i]['nextPoint'];
|
$target_id = $recommandResult[$i]['nextPoint'];
|
||||||
$isEntity = $recommandResult[$i]['isEntity'];
|
$isEntity = $recommandResult[$i]['isEntity'];
|
||||||
array_push($output_targets, output_the_target_array($target_id, $isEntity, $materialMode));
|
array_push($output_targets, output_the_target_array($target_id, $isEntity, $materialMode));
|
||||||
array_push($output_target_ids, $target_id);
|
array_push($output_target_ids, $target_id);
|
||||||
|
|
||||||
|
// TODO: 標的進出資料多增加行進中、確實進入的欄位
|
||||||
|
if($maxItemTotal == 1) {
|
||||||
|
$sid = $sact->enteringInTarget($target_id, true);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: 標的進出資料多增加行進中、確實進入的欄位
|
|
||||||
if($maxItemTotal == 1) {
|
|
||||||
$sid = $sact->enteringInTarget($target_id, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 紀錄所有推薦進歷程
|
||||||
|
$recommand->insertRecommandHistory($saId, $output_target_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 紀錄所有推薦進歷程
|
|
||||||
$recommand->insertRecommandHistory($saId, $output_target_ids);
|
|
||||||
|
|
||||||
// 噴出結果
|
// 噴出結果
|
||||||
$app->render(201,array(
|
$app->render(201,array(
|
||||||
|
@ -24,7 +24,7 @@ class DBRecommand extends Database
|
|||||||
|
|
||||||
protected function queryEdgeByWhere($where)
|
protected function queryEdgeByWhere($where)
|
||||||
{
|
{
|
||||||
$sqlString = "SELECT DISTINCT ".$this->table('learn_path').".Ti, ".$this->table('learn_path').".Tj, ".$this->table('learn_path').".MoveTime".
|
$sqlString = "SELECT DISTINCT Ti, Tj, MoveTime".
|
||||||
" FROM ".$this->table('learn_path')." WHERE ".$where;
|
" FROM ".$this->table('learn_path')." WHERE ".$where;
|
||||||
$query = $this->connDB->prepare($sqlString);
|
$query = $this->connDB->prepare($sqlString);
|
||||||
$query->execute();
|
$query->execute();
|
||||||
@ -93,8 +93,7 @@ class DBRecommand extends Database
|
|||||||
*/
|
*/
|
||||||
public function queryEdgeByID($currentPoint)
|
public function queryEdgeByID($currentPoint)
|
||||||
{
|
{
|
||||||
$AllOfResult = $this->queryEdgeByWhere($this->table('learn_path').".Ti = ".$this->connDB->quote($currentPoint)." OR ".
|
$AllOfResult = $this->queryEdgeByWhere($this->table('learn_path').".Ti = ".$this->connDB->quote($currentPoint));
|
||||||
$this->table('learn_path').".Tj = ".$this->connDB->quote($currentPoint));
|
|
||||||
if(count($AllOfResult) != 0) return $AllOfResult;
|
if(count($AllOfResult) != 0) return $AllOfResult;
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
@ -465,8 +465,7 @@ class DBStudy extends Database {
|
|||||||
|
|
||||||
$queryResultAll = $this->queryByWhere(
|
$queryResultAll = $this->queryByWhere(
|
||||||
"`TID` = ".$this->connDB->quote($target_id).
|
"`TID` = ".$this->connDB->quote($target_id).
|
||||||
" AND `SaID` = ".$this->connDB->quote($activity_id).
|
" AND `SaID` = ".$this->connDB->quote($activity_id));
|
||||||
" AND `IsEnter` = '1'");
|
|
||||||
|
|
||||||
return $queryResultAll;
|
return $queryResultAll;
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,8 @@ class RecommandPoint
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function insertRecommandHistory($activity_id, $target_ids) {
|
public function insertRecommandHistory($activity_id, $target_ids) {
|
||||||
|
if( count($target_ids) > 0 ) {
|
||||||
return $this->recommand->insertRecommandHistory($activity_id, $target_ids);
|
return $this->recommand->insertRecommandHistory($activity_id, $target_ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user