|
|
@@ -52,6 +52,7 @@ class Product extends BaseController
|
|
|
['limit', 20],
|
|
|
['store_name', ''],
|
|
|
['cate_id', ''],
|
|
|
+ ['label', ''],
|
|
|
['excel', 0],
|
|
|
['type', 1]
|
|
|
]);
|
|
|
@@ -244,6 +245,7 @@ class Product extends BaseController
|
|
|
['issuing', 0],
|
|
|
['is_leftover', 0],
|
|
|
['is_hot', 0],
|
|
|
+ ['is_new', 0],
|
|
|
['is_best', 0],
|
|
|
['is_sub', 0],
|
|
|
['description', ''],
|
|
|
@@ -297,6 +299,7 @@ class Product extends BaseController
|
|
|
$data['add_time'] = time();
|
|
|
$data['code_path'] = '';
|
|
|
$res = ProductModel::create($data);
|
|
|
+ ProductModel::where('id',$res['id'])->update(['code' => sprintf("%05d", $res['id'])]);
|
|
|
if ($data['spec_type'] == 0) {
|
|
|
$attr = [
|
|
|
[
|
|
|
@@ -389,7 +392,7 @@ class Product extends BaseController
|
|
|
*/
|
|
|
public function product_info($id)
|
|
|
{
|
|
|
- $info = ProductModel::where('id', $id)->field('id,image,price,ot_price,cost')->find()->toArray();
|
|
|
+ $info = ProductModel::where('id', $id)->field('id,store_name,image,price,ot_price,cost,postage')->find()->toArray();
|
|
|
$score = Db::name("product_score")->where('product_id', $id)->find();
|
|
|
if($score){
|
|
|
$info['attribute'] = json_decode($score['attribute'], true);
|
|
|
@@ -409,6 +412,7 @@ class Product extends BaseController
|
|
|
'stars'
|
|
|
]);
|
|
|
$data["attribute"] = json_encode($data["attribute"]);
|
|
|
+ ProductModel::where('id', $data['product_id'])->update(['stars'=>$data["stars"]]);
|
|
|
$score = Db::name("product_score")->where('product_id', $data['product_id'])->find();
|
|
|
if($score){
|
|
|
$res = Db::name("product_score")->where('product_id', $data['product_id'])->update($data);
|