作者 王智

修改

@@ -112,9 +112,7 @@ class Index extends Api @@ -112,9 +112,7 @@ class Index extends Api
112 'Battery' => htmlspecialchars_decode($params['Battery']), 112 'Battery' => htmlspecialchars_decode($params['Battery']),
113 ]; 113 ];
114 $Res = Db::name('stor')->insert($data); 114 $Res = Db::name('stor')->insert($data);
115 - $StorID = Db::name('stor')->where('user_id', $UserId)->value('id');  
116 - $this->NameCarQrCode('storID' . $StorID, $params['url'] . '?stor_id=' . $StorID);  
117 - Db::name('stor')->where('user_id', $UserId)->where(['user_id' => $UserId, 115 + $StorID = Db::name('stor')->where(['user_id' => $UserId,
118 'createtime' => time(), 116 'createtime' => time(),
119 'updatetime' => time(), 117 'updatetime' => time(),
120 'avatar' => $params['avatar'], 118 'avatar' => $params['avatar'],
@@ -125,7 +123,9 @@ class Index extends Api @@ -125,7 +123,9 @@ class Index extends Api
125 'address_con' => $params['address_con'], 123 'address_con' => $params['address_con'],
126 'mobile' => $params['mobile'], 124 'mobile' => $params['mobile'],
127 'hours' => $params['hours'], 125 'hours' => $params['hours'],
128 - 'Battery' => htmlspecialchars_decode($params['Battery']),])->update(['stor_image' => '/images/storID' . $StorID . '.png']); 126 + 'Battery' => htmlspecialchars_decode($params['Battery']),])->value('id');
  127 + $this->NameCarQrCode('storID' . $StorID, $params['url'] . '?stor_id=' . $StorID);
  128 + Db::name('stor')->where('user_id', $UserId)->where('id', $StorID)->update(['stor_image' => '/images/storID' . $StorID . '.png']);
129 } else { 129 } else {
130 $data = [ 130 $data = [
131 'updatetime' => time(), 131 'updatetime' => time(),