Skip to content

Commit

Permalink
Merge pull request #97 from undefinedor/remove-unused-import
Browse files Browse the repository at this point in the history
Remove unused import.
  • Loading branch information
fancyecommerce authored Jun 4, 2021
2 parents 4d3c7fa + 3130062 commit a230a87
Show file tree
Hide file tree
Showing 131 changed files with 1,540 additions and 1,705 deletions.
13 changes: 6 additions & 7 deletions app/appadmin/modules/AppadminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace fecshop\app\appadmin\modules;

use fec\controllers\FecController;
use fec\helpers\CConfig;
use Yii;
use yii\base\InvalidValueException;
Expand All @@ -23,7 +22,7 @@ class AppadminController extends Controller
{
public $blockNamespace;
public $enableCsrfValidation = true;

/**
* init theme component property : $fecshopThemeDir and $layoutFile
* $fecshopThemeDir is appfront base theme directory.
Expand Down Expand Up @@ -82,7 +81,7 @@ public function beforeAction($action)

return false;
}


/**
* @param $view|string , (only) view file name ,by this module id, this controller id , generate view relative path.
Expand Down Expand Up @@ -117,7 +116,7 @@ public function findLayoutFile($view)
}
throw new InvalidValueException('layout file is not exist!');
}

public function getFecadminBlock($blockname=''){
$_currentNameSpace = \fec\helpers\CModule::param("_currentNameSpace");
//echo $_currentNameSpace;exit;
Expand All @@ -136,16 +135,16 @@ public function getFecadminBlock($blockname=''){
}else{
$url_key_arr[count($url_key_arr)-1] = ucfirst($url_key_arr[count($url_key_arr)-1]);
}

$block_space = implode("\\",$url_key_arr);
$blockFile = $modulesDir.$block_space;
//查找是否在rewriteMap中存在重写
//$relativeFile = Yii::mapGetName($relativeFile);
$blockFile = Yii::mapGetName($blockFile);
//echo $blockFile;exit;

return new $blockFile;

}

public function getBlock($blockName = ''){
Expand Down
3 changes: 1 addition & 2 deletions app/appadmin/modules/Catalog/CatalogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
* @author Terry Zhao <[email protected]>
* @since 1.0
*/
use fecadmin\FecadminbaseController;
use Yii;

use fecshop\app\appadmin\modules\AppadminController;

class CatalogController extends AppadminController
Expand Down
48 changes: 16 additions & 32 deletions app/appadmin/modules/Catalog/block/categoryupload/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace fecshop\app\appadmin\modules\Catalog\block\categoryupload;

use fecshop\app\appadmin\interfaces\base\AppadminbaseBlockInterface;
use fecshop\app\appadmin\modules\AppadminbaseBlock;
use Yii;
use yii\base\BaseObject;

Expand All @@ -21,7 +19,7 @@
*/
class Manager extends BaseObject
{

public $_fileFullDir;
/**
* init param function ,execute in construct.
Expand All @@ -39,14 +37,14 @@ public function getLastData()
return [
];
}


public function uploadCategory()
{
$fileFullDir = Yii::getAlias('@appadmin/runtime/upload/');
if ($this->saveUploadExcelFile($fileFullDir)) {
//echo $this->_fileFullDir;

$arr = \fec\helpers\CExcel::getExcelContent($this->_fileFullDir);
$i = 0;
if (is_array($arr) && !empty($arr)) {
Expand All @@ -71,9 +69,9 @@ public function uploadCategory()
]);
exit;
}

}

public function saveCategory($one)
{
// 从excel中获取数据。
Expand All @@ -93,22 +91,22 @@ public function saveCategory($one)
$meta_description = $one['K'];
$image = $one['L'];
$thumbnail_image = $one['M'];


$nameLang = Yii::$service->fecshoplang->getLangAttrName('name',$language_code);
$titleLang = Yii::$service->fecshoplang->getLangAttrName('title',$language_code);
$metaKeywordsLang = Yii::$service->fecshoplang->getLangAttrName('meta_keywords',$language_code);
$metaDescriptionLang = Yii::$service->fecshoplang->getLangAttrName('meta_description',$language_code);
$descriptionLang = Yii::$service->fecshoplang->getLangAttrName('description',$language_code);

$categoryPrimaryKey = Yii::$service->category->getPrimaryKey();
//$categoryMode = Yii::$service->category->getByPrimarykey($category_id);
//$categoryPrimaryKey = Yii::$service->category->getPrimaryKey();
//$category_id = '';
//if ($categoryMode && isset($categoryMode[$categoryPrimaryKey]) && $categoryMode[$categoryPrimaryKey]) {
// $category_id = $categoryMode[$categoryPrimaryKey];
//}

$categoryArr[$categoryPrimaryKey] = $category_id;
$categoryArr['parent_id'] = $parent_id;
$categoryArr['name'][$nameLang] = $category_name;
Expand All @@ -121,37 +119,23 @@ public function saveCategory($one)
$categoryArr['meta_description'][$metaDescriptionLang] = $meta_description;
$categoryArr['image'] = $image;
$categoryArr['thumbnail_image'] = $thumbnail_image;

return Yii::$service->category->excelSave($categoryArr);
}

# 1.保存前台上传的文件。
public function saveUploadExcelFile($fileFullDir){

$name = $_FILES["file"]["name"];
$fileFullDir .= 'category_'.time().'_'.rand(1000,9999);
if(strstr($name,'.xlsx')){
$fileFullDir .='.xlsx';
} else if (strstr($name,'.xls')){
$fileFullDir .='.xls';
}
$this->_fileFullDir = $fileFullDir;
}
$this->_fileFullDir = $fileFullDir;
$result = @move_uploaded_file($_FILES["file"]["tmp_name"],$fileFullDir);

return $result;
}














}
11 changes: 5 additions & 6 deletions app/appadmin/modules/Catalog/block/productattr/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace fecshop\app\appadmin\modules\Catalog\block\productattr;

use fec\helpers\CUrl;
use fec\helpers\CRequest;
use fecshop\app\appadmin\interfaces\base\AppadminbaseBlockInterface;
use fecshop\app\appadmin\modules\AppadminbaseBlock;
use Yii;
Expand Down Expand Up @@ -81,7 +80,7 @@ public function getSearchArr()
2 => Yii::$service->page->translate->__('Disable'),
],
],

];

return $data;
Expand Down Expand Up @@ -112,7 +111,7 @@ public function getTableFieldArr()
'width' => '110',
'align' => 'left',
],

[
'orderField' => 'status',
'label' => Yii::$service->page->translate->__('Status'),
Expand All @@ -123,14 +122,14 @@ public function getTableFieldArr()
2 => Yii::$service->page->translate->__('Disable'),
],
],

[
'orderField' => 'db_type',
'label' => Yii::$service->page->translate->__('Db Type'),
'width' => '110',
'align' => 'center',
],

[
'orderField' => 'show_as_img',
'label' => Yii::$service->page->translate->__('Show As Img'),
Expand All @@ -141,7 +140,7 @@ public function getTableFieldArr()
2 => Yii::$service->page->translate->__('No'),
],
],

[
'orderField' => 'display_type',
'label' => Yii::$service->page->translate->__('Display Type'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace fecshop\app\appadmin\modules\Catalog\block\productattrgroup;

use fec\helpers\CUrl;
use fec\helpers\CRequest;
use fecshop\app\appadmin\interfaces\base\AppadminbaseBlockInterface;
use fecshop\app\appadmin\modules\AppadminbaseBlock;
use Yii;
Expand Down Expand Up @@ -81,7 +80,7 @@ public function getSearchArr()
2 => Yii::$service->page->translate->__('Disable'),
],
],

];

return $data;
Expand Down Expand Up @@ -115,7 +114,7 @@ public function getTableFieldArr()
2 => Yii::$service->page->translate->__('Disable'),
],
],

[
'orderField' => 'created_at',
'label' => Yii::$service->page->translate->__('Created At'),
Expand Down
23 changes: 11 additions & 12 deletions app/appadmin/modules/Catalog/block/productbrand/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace fecshop\app\appadmin\modules\Catalog\block\productbrand;

use fec\helpers\CUrl;
use fec\helpers\CRequest;
use fecshop\app\appadmin\interfaces\base\AppadminbaseBlockInterface;
use fecshop\app\appadmin\modules\AppadminbaseBlock;
Expand Down Expand Up @@ -82,7 +81,7 @@ public function getSearchArr()
2 => Yii::$service->page->translate->__('Disable'),
],
],

[ // 时间区间类型搜索
'type' => 'inputdatefilter',
'name' => 'created_at',
Expand All @@ -102,9 +101,9 @@ public function getSearchArr()
*/
public function getTableFieldArr()
{
$brandCategorys = Yii::$service->product->brandcategory->getBrandCategoryIdAndNames();
$brandCategorys = Yii::$service->product->brandcategory->getBrandCategoryIdAndNames();
$brandStatus = Yii::$service->product->brandcategory->getStatusArr();

$table_th_bar = [
[
'orderField' => $this->_primaryKey,
Expand Down Expand Up @@ -140,16 +139,16 @@ public function getTableFieldArr()
'width' => '110',
'align' => 'center',
],

[
'orderField' => 'status',
'label' => Yii::$service->page->translate->__('Status'),
'width' => '50',
'align' => 'center',
'display' => $brandStatus,
],


[
'orderField' => 'created_at',
'label' => Yii::$service->page->translate->__('Created At'),
Expand All @@ -168,9 +167,9 @@ public function getTableFieldArr()

return $table_th_bar;
}



public function getTableTbodyHtml($data)
{
$fields = $this->getTableFieldArr();
Expand Down Expand Up @@ -250,6 +249,6 @@ public function getTableTbodyHtml($data)

return $str;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

namespace fecshop\app\appadmin\modules\Catalog\block\productbrandcategory;

use fec\helpers\CUrl;
use fec\helpers\CRequest;
use fecshop\app\appadmin\interfaces\base\AppadminbaseBlockInterface;
use fecshop\app\appadmin\modules\AppadminbaseBlock;
use Yii;
Expand Down Expand Up @@ -82,7 +80,7 @@ public function getSearchArr()
2 => Yii::$service->page->translate->__('Disable'),
],
],

[ // 时间区间类型搜索
'type' => 'inputdatefilter',
'name' => 'created_at',
Expand All @@ -102,9 +100,9 @@ public function getSearchArr()
*/
public function getTableFieldArr()
{
$brandCategorys = Yii::$service->product->brandcategory->getBrandCategoryIdAndNames();
$brandCategorys = Yii::$service->product->brandcategory->getBrandCategoryIdAndNames();
$brandStatus = Yii::$service->product->brandcategory->getStatusArr();

$table_th_bar = [
[
'orderField' => $this->_primaryKey,
Expand All @@ -125,17 +123,17 @@ public function getTableFieldArr()
'width' => '110',
'align' => 'center',
],


[
'orderField' => 'status',
'label' => Yii::$service->page->translate->__('Status'),
'width' => '50',
'align' => 'center',
'display' => $brandStatus,
],


[
'orderField' => 'created_at',
'label' => Yii::$service->page->translate->__('Created At'),
Expand Down
Loading

0 comments on commit a230a87

Please sign in to comment.