Commit acf382a6 authored by wwccw0591's avatar wwccw0591

pc

parent f9664330
......@@ -13,7 +13,7 @@ class GoodsCommonStorageModel extends \DAO\AbstractModel {
*
* @var string
*/
protected $_tableName = 'han_goods_common_storage;';
protected $_tableName = 'han_goods_common_storage';
/**
* 主键
......@@ -63,13 +63,51 @@ class GoodsCommonStorageModel extends \DAO\AbstractModel {
}
public function getAll(){
$this->setDb($this->dbName);
$res=$this->db->fetchAll();
$res=$this->db->from($this->_tableName)->fetchAll();
return $res;
}
public function createTestData(){
$res =$this->getAll();
echo json_encode($res);exit;
$insertNames=array();
$insertArray=array();
$one= array('状元笔记','三点一测','初高中','另类学习','天才辅导','启蒙','课外学习','小天才','深入理解','黄冈练习');
$two=array('七年级','八年级','九年级');
$three=array('语文','数学','英语','物理','化学','生物','地理','历史','政治');
$four=array('人教版','北师大版','苏教版');
$five=array('上册','下册');
$goodsStorage=\DAO\Storage\GoodsStorageModel::getInstance();
foreach($one as $onekey=>$oneVal){
foreach($two as $twoKey=>$twoVal){
foreach($three as $threeKey=>$threeVal){
foreach($four as $fourKey=>$fourVal){
foreach($five as $fiveKey=>$fiveVal){
$diffKey=(string)$onekey.(string)$twoKey.(string)$threeKey.(string)$fourKey.(string)$fiveKey;
$catName=$oneVal.$twoVal.$threeVal.$fourVal.$fiveVal;
$resultIndex=array_rand($res);
$re=$res[$resultIndex];
$re['goods_commonid']=500000+(int)$diffKey;
$re['goods_name']=$catName;
$re['goods_jingle']=$catName;
$re['gc_name']='学习辅导课程';
$re['store_id']=117;
$re['store_name']='文创园';
$re['goods_addtime']=TIMESTAMP;
$this->db->insert($this->_tableName)->rows($re)->execute();
$goodsStorage->addOne($re);
}
}
}
}
}
}
/**
* 商品列表(需要获取销售价格)
* @param $where
......
......@@ -94,8 +94,41 @@ class GoodsStorageModel extends \DAO\AbstractModel {
}
return $goodsList;
}
public function getAll(){
$this->setDb($this->dbName);
$res=$this->db->from($this->_tableName)->fetchAll();
return $res;
}
public function addOne($res){
$addData['goods_id']=$res['goods_commonid'];
$addData['goods_commonid']=$res['goods_commonid'];
$addData['goods_name']=$res['goods_name'];
$addData['goods_jingle']=$res['goods_jingle'];
$addData['store_id']=$res['store_id'];
$addData['store_name']=$res['store_name'];
$addData['gc_id']=$res['gc_id'];
$addData['gc_id_1']=$res['gc_id_1'];
$addData['gc_id_2']=$res['gc_id_2'];
$addData['gc_id_3']=$res['gc_id_3'];
$addData['brand_id']=$res['brand_id'];
$addData['goods_price']=$res['goods_price'];
$addData['goods_marketprice']=$res['goods_marketprice'];
$addData['goods_spec']='';
$addData['goods_image']=$res['goods_image'];
$addData['goods_state']=$res['goods_state'];
$addData['goods_verify']=$res['goods_verify'];
$addData['goods_addtime']=$res['goods_addtime'];
$addData['goods_edittime']=$res['goods_edittime'];
$addData['color_id']=0;
$addData['is_virtual']=$res['is_virtual'];
$addData['virtual_indate']=$res['virtual_indate'];
$addData['virtual_limit']=$res['virtual_limit'];
$addData['virtual_invalid_refund']=$res['virtual_invalid_refund'];
$addData['goods_youku_url']=$res['goods_youku_url'];
$addData['goods_barcode']=$res['goods_barcode'];
$this->setDb($this->dbName);
$this->db->insert($this->_tableName)->rows($addData)->execute();
}
public function validEditCartGoods($where,$cart,$storageFlag = true){
$goods = $this->getOnlineOne($where['goodsId']);
......
......@@ -51,7 +51,7 @@ class cliGrow extends basecli
echo "*** Debug mode ***\n";
}
// Step: 02 检查是否已有相同CLI在运行中
$lockDir = $this->_getBaseFileName('shopkeeper');
$lockDir = $this->_getBaseFileName('growGoodsStores');
if (!$this->mkdirs($lockDir)) {
echo '****create dir fail ****';
exit;
......@@ -77,7 +77,7 @@ class cliGrow extends basecli
} catch (Exception $ex) {
throw new Exception($ex->getCode() . '|' . $ex->getMessage());
}
echo '店铺订单索引生成成功' .date('Y-m-d H:i:s',TIMESTAMP). "\r\n";
echo '店铺生成成功' .date('Y-m-d H:i:s',TIMESTAMP). "\r\n";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment