|
@@ -19,7 +19,7 @@ class generator
|
|
|
public function __construct($commonid, $num, $batch_code, $usable_days)
|
|
|
{
|
|
|
$this->mCommonId = $commonid;
|
|
|
- $this->mNumber = $num;
|
|
|
+ $this->mNumber = intval($num);
|
|
|
|
|
|
if(empty($batch_code)) {
|
|
|
$this->mBatchCode = 'XMMZ';
|
|
@@ -38,7 +38,7 @@ class generator
|
|
|
public function make()
|
|
|
{
|
|
|
$mod_fcode = Model('goods_fcode');
|
|
|
- for ($i = 0; $i < $this->mNumber;)
|
|
|
+ for ($i = 0; $i < $this->mNumber;)
|
|
|
{
|
|
|
$fc_code = sprintf("%06s%04d%06d",$this->mBatchCode,$this->mCommonId,mt_rand(100000, 999999));
|
|
|
|
|
@@ -52,7 +52,7 @@ class generator
|
|
|
|
|
|
$ret = $mod_fcode->insert($data);
|
|
|
$affect_rows = $mod_fcode->affected_rows();
|
|
|
-
|
|
|
+ Log::record("fcode make ret={$ret} rows={$affect_rows}");
|
|
|
if($ret != false && $affect_rows > 0) {
|
|
|
++$i;
|
|
|
}
|