質問編集履歴
3
コード訂正
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,10 +23,10 @@
|
|
23
23
|
url: "",
|
24
24
|
dataType: "text",
|
25
25
|
data: {
|
26
|
-
"a"
|
26
|
+
"a": a,
|
27
|
-
"b"
|
27
|
+
"b": b,
|
28
|
-
"point"
|
28
|
+
"point":point,
|
29
|
-
|
29
|
+
"checked" : checked,
|
30
30
|
},
|
31
31
|
success: function() {
|
32
32
|
$('#a').modal('hide');
|
@@ -56,8 +56,6 @@
|
|
56
56
|
$point = $data['0']['0']['point'];
|
57
57
|
$this->set('point',$point);
|
58
58
|
|
59
|
-
$this->Session->write('point', $point);//Sessionを試してみる
|
60
|
-
|
61
59
|
}
|
62
60
|
|
63
61
|
public function index() {
|
@@ -79,14 +77,6 @@
|
|
79
77
|
$this->Point->save($data);
|
80
78
|
exit;
|
81
79
|
}
|
82
|
-
//Sessionを試してみる
|
83
|
-
if(SessionComponent::check('point')){
|
84
|
-
print_r($this->Session->read('point'));
|
85
|
-
$this->Session->delete('point');
|
86
|
-
}
|
87
|
-
else{
|
88
|
-
print_r("セッションに格納された値はありません!");
|
89
|
-
}
|
90
80
|
}
|
91
81
|
```
|
92
82
|
###試したこと
|
2
コード修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -50,13 +50,13 @@
|
|
50
50
|
$data = $this->Point->find('all',
|
51
51
|
array(
|
52
52
|
'conditions'=> array('Point.id' => $id),
|
53
|
-
'fields' => array('sum(point) as
|
53
|
+
'fields' => array('sum(point) as point'),
|
54
54
|
)
|
55
55
|
);
|
56
|
-
$
|
56
|
+
$point = $data['0']['0']['point'];
|
57
|
-
$this->set('
|
57
|
+
$this->set('point',$point);
|
58
58
|
|
59
|
-
$this->Session->write('
|
59
|
+
$this->Session->write('point', $point);//Sessionを試してみる
|
60
60
|
|
61
61
|
}
|
62
62
|
|
@@ -80,9 +80,9 @@
|
|
80
80
|
exit;
|
81
81
|
}
|
82
82
|
//Sessionを試してみる
|
83
|
-
if(SessionComponent::check('
|
83
|
+
if(SessionComponent::check('point')){
|
84
|
-
print_r($this->Session->read('
|
84
|
+
print_r($this->Session->read('point'));
|
85
|
-
$this->Session->delete('
|
85
|
+
$this->Session->delete('point');
|
86
86
|
}
|
87
87
|
else{
|
88
88
|
print_r("セッションに格納された値はありません!");
|
1
コード修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -49,8 +49,8 @@
|
|
49
49
|
$id = $this->Auth->user('id');
|
50
50
|
$data = $this->Point->find('all',
|
51
51
|
array(
|
52
|
-
'conditions'=> array('Point.
|
52
|
+
'conditions'=> array('Point.id' => $id),
|
53
|
-
'fields' => array('sum(
|
53
|
+
'fields' => array('sum(point) as sumPoints'),
|
54
54
|
)
|
55
55
|
);
|
56
56
|
$sumPoints = $data['0']['0']['sumPoints'];
|