|
@@ -45,17 +45,17 @@ class Card
|
|
|
$one = Dever::db('youzan/card_list')->one(array('option_card_id' => $info['id'], 'option_user' => $user));
|
|
|
if (!$one) {
|
|
|
|
|
|
- $id = Dever::queue('lock');
|
|
|
+
|
|
|
+ $id = false;
|
|
|
if ($id) {
|
|
|
$card = Dever::db('youzan/card_list')->one($id);
|
|
|
- }
|
|
|
+ } else {
|
|
|
$list = Dever::db('youzan/card_list')->getAll(array('option_card_id' => $info['id'], 'option_status' => 1));
|
|
|
$key = array_rand($list);
|
|
|
if (isset($list[$key]) && $list[$key]) {
|
|
|
$card = $list[$key];
|
|
|
}
|
|
|
}
|
|
|
- */
|
|
|
|
|
|
if (isset($card) && $card) {
|
|
|
Dever::db('youzan/card_list')->update(array('where_id' => $card['id'], 'user' => $user, 'status' => 2));
|