|
@@ -179,7 +179,7 @@ class Active
|
|
|
$insert['active_id'] = $order['active_id'];
|
|
|
$insert['buy_uid'] = $order['uid'];
|
|
|
$insert['order_id'] = $order['id'];
|
|
|
- $insert['write_code'] = Dever::load('active/home')->getCode();
|
|
|
+ $insert['write_code'] = $this->getCode();
|
|
|
$insert['act_status'] = $active['act_status'];
|
|
|
$ids = Dever::db('active/code')->insert($insert);
|
|
|
if ($ids) {
|
|
@@ -195,6 +195,18 @@ class Active
|
|
|
return 'ok';
|
|
|
}
|
|
|
|
|
|
+ #活动核销码
|
|
|
+ public function getCode()
|
|
|
+ {
|
|
|
+ $where['write_code'] = Dever::rand(6, 0);
|
|
|
+ $state = Dever::db('active/code')->one($where);
|
|
|
+ if (!$state) {
|
|
|
+ return $where['write_code'];
|
|
|
+ } else {
|
|
|
+ return $this->getCode();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#生成订单号
|
|
|
public function getOrderId()
|
|
|
{
|