ä»å¹´7æã«å ¥ã£ã¦ããæ¥åã§CakePHPã使ç¨ãã¦ãããå¤å½äººããã°ã©ãéã«ãã£ã¦æ¸ãããã½ã¼ã¹ã®æ¹ä¿®ã¨ããã©ã¼ãã³ã¹ã»ãã¥ã¼ãã³ã°ãè¡ã£ã¦ãã¾ãã ãã®éãDBæ´æ°å¦çã§SQLã®çºè¡åæ°ãæ¸ããå¿ è¦ãçããã®ã§ããã®å¯¾å¿æ¹æ³ãè¿°ã¹ããã¨æãã¾ãï¼éè¦ã¯ãã¾ããªããããªãï¼ saveã¡ã½ããã®SQLçºè¡åæ°ã¯å¤ãï¼ DBã®æ´æ°å¦çã«ã¯saveã¡ã½ããã使ç¨ãããã¨ãå¤ãã¨æãã¾ãããå®ã¯ããã¤ãããªãã®æ²è ã§ãã ç¾èã¯ä¸è¦ã«å¦ããã§ãã ã¾ãä¸ã®ã¡ã½ãããè¦ã¦ãã ããã public function addPoint($user_id, $point) { $user = $this->findById($user_id); $user['User']['point'] += $point; $this->save($user); } å®éã«ä»ã®æ¡ä»¶ã§æ£è¦ãããsaveã¡ã½ããã®ä½¿ãæ¹
{{#tags}}- {{label}}
{{/tags}}