質問編集履歴

2

sqlの追記

2017/04/21 05:47

投稿

TomoKubota
TomoKubota

スコア53

test CHANGED
File without changes
test CHANGED
@@ -85,3 +85,53 @@
85
85
  });
86
86
 
87
87
  ```
88
+
89
+
90
+
91
+ ```sql
92
+
93
+ //Cakeで作成されたSQL
94
+
95
+ SELECT
96
+
97
+ AvailableProducts.id AS `AvailableProducts__id`,
98
+
99
+ AvailableProducts.farmer_id AS `AvailableProducts__farmer_id`,
100
+
101
+ AvailableProducts.vegetable_id AS `AvailableProducts__vegetable_id`,
102
+
103
+ AvailableProducts.available_amount AS `AvailableProducts__available_amount`,
104
+
105
+ AvailableProducts.info AS `AvailableProducts__info`,
106
+
107
+ AvailableProducts.preserve_advice AS `AvailableProducts__preserve_advice`
108
+
109
+ FROM available_products AvailableProducts
110
+
111
+ WHERE (AvailableProducts.farmer_id = :c0 AND AvailableProducts.vegetable_id = :c1)
112
+
113
+ ```
114
+
115
+
116
+
117
+ ```sql
118
+
119
+ SELECT
120
+
121
+ AvailableProducts.id AS `AvailableProducts__id`,
122
+
123
+ AvailableProducts.farmer_id AS `AvailableProducts__farmer_id`,
124
+
125
+ AvailableProducts.vegetable_id AS `AvailableProducts__vegetable_id`,
126
+
127
+ AvailableProducts.available_amount AS `AvailableProducts__available_amount`,
128
+
129
+ AvailableProducts.info AS `AvailableProducts__info`,
130
+
131
+ AvailableProducts.preserve_advice AS `AvailableProducts__preserve_advice`
132
+
133
+ FROM available_products AvailableProducts
134
+
135
+ WHERE (AvailableProducts.farmer_id = 1 AND AvailableProducts.vegetable_id = 4)
136
+
137
+ ```

1

jsスクリプトの追記

2017/04/21 05:47

投稿

TomoKubota
TomoKubota

スコア53

test CHANGED
File without changes
test CHANGED
@@ -43,3 +43,45 @@
43
43
 
44
44
 
45
45
  ```
46
+
47
+
48
+
49
+ ```javascript
50
+
51
+
52
+
53
+ $.ajax({
54
+
55
+ url: href + "/checkDataRegisteredByAjax",
56
+
57
+ type: "POST",
58
+
59
+ data: { "param": param },
60
+
61
+ dataType: "json",
62
+
63
+ success : function(response){
64
+
65
+ console.log(response);
66
+
67
+ return;
68
+
69
+ //通信が成功した場合
70
+
71
+ if(response != false){
72
+
73
+
74
+
75
+ }
76
+
77
+ },
78
+
79
+ error: function(response){
80
+
81
+ alert('通信失敗');
82
+
83
+ }
84
+
85
+ });
86
+
87
+ ```