|
@@ -16,6 +16,7 @@ require_once(BASE_ROOT_PATH . '/helper/kdn_helper.php');
|
|
|
require_once(BASE_ROOT_PATH . '/helper/statistics_helper.php');
|
|
|
require_once(BASE_ROOT_PATH . '/helper/member_helper.php');
|
|
|
require_once(BASE_ROOT_PATH . '/helper/account_helper.php');
|
|
|
+require_once(BASE_ROOT_PATH . '/helper/fcode/generator.php');
|
|
|
|
|
|
class queueLogic
|
|
|
{
|
|
@@ -227,20 +228,10 @@ class queueLogic
|
|
|
*/
|
|
|
public function createGoodsFCode($param)
|
|
|
{
|
|
|
- $insert = array();
|
|
|
- for ($i = 0; $i < $param['fc_count']; $i++) {
|
|
|
- $array = array();
|
|
|
- $array['goods_commonid'] = $param['goods_commonid'];
|
|
|
- $array['fc_code'] = strtoupper($param['fc_prefix']) . mt_rand(100000, 999999);
|
|
|
- $insert[$array['fc_code']] = $array;
|
|
|
- }
|
|
|
- if (!empty($insert)) {
|
|
|
- $insert = array_values($insert);
|
|
|
- $insert = Model('goods_fcode')->addGoodsFCodeAll($insert);
|
|
|
- if (!$insert) {
|
|
|
- return callback(false, '生成商品F码失败goods_commonid:' . $param['goods_commonid']);
|
|
|
- }
|
|
|
- }
|
|
|
+ $gen = new fcode\generator($param['goods_commonid'],$param['fc_count'],$param['fc_prefix'],10);
|
|
|
+ $url = $gen->make();
|
|
|
+ Log::record("createGoodsFCode url={$url}",Log::DEBUG);
|
|
|
+
|
|
|
return callback(true);
|
|
|
}
|
|
|
|