作者 王智

xiugai

@@ -261,16 +261,16 @@ class Config extends Api @@ -261,16 +261,16 @@ class Config extends Api
261 //Gift 261 //Gift
262 $IsHave = Db::name('message')->where(['user_id' => $UserId, 'ob_id' => $Params['ob_id'], 'type' => 2])->find(); 262 $IsHave = Db::name('message')->where(['user_id' => $UserId, 'ob_id' => $Params['ob_id'], 'type' => 2])->find();
263 if ($Params['gift_id'] != 0) { 263 if ($Params['gift_id'] != 0) {
264 - if (!empty($IsHave)) {  
265 - //update  
266 - if ($IsHave['gift_id'] != 0) {  
267 -// $this->error('只能送出一份礼物');  
268 - }  
269 - $data = [  
270 - 'gift_id' => $Params['gift_id']  
271 - ];  
272 - $Res = Db::name('message')->where(['user_id' => $UserId, 'ob_id' => $Params['ob_id'], 'type' => 2])->update($data);  
273 - } else { 264 +// if (!empty($IsHave)) {
  265 +// //update
  266 +// if ($IsHave['gift_id'] != 0) {
  267 +//// $this->error('只能送出一份礼物');
  268 +// }
  269 +// $data = [
  270 +// 'gift_id' => $Params['gift_id']
  271 +// ];
  272 +// $Res = Db::name('message')->where(['user_id' => $UserId, 'ob_id' => $Params['ob_id'], 'type' => 2])->update($data);
  273 +// } else {
274 //add 274 //add
275 $data = [ 275 $data = [
276 'user_id' => $UserId, 276 'user_id' => $UserId,
@@ -282,7 +282,7 @@ class Config extends Api @@ -282,7 +282,7 @@ class Config extends Api
282 'createtime' => time() 282 'createtime' => time()
283 ]; 283 ];
284 $Res = Db::name('message')->insert($data); 284 $Res = Db::name('message')->insert($data);
285 - } 285 +// }
286 } else { 286 } else {
287 //Message 287 //Message
288 // if (!empty($IsHave)) { 288 // if (!empty($IsHave)) {