📄 product_controller.php
字号:
<?phpclass Products extends UaModel { var $table_name = "products AS Product"; var $name = "Product"; var $common_cols = "sort_id AS ProductSortId,Product.sn AS SerialNumber,Product.id AS ID,industry_id AS IndustryID,Product.name AS Name,Product.picture AS ProductPicture,content AS Description,Product.created AS CreateDate,Product.status AS ProductStatus,Product.state AS ProductState,html_file_id AS HtmlFileId"; var $industry_cols = "Product.id,Product.member_id as MemberId,Product.id AS ProductId,Product.name AS Name,Product.name AS ProductName,Product.content AS Content,Product.industry_id AS IndustryID,Product.picture,Product.created,Product.keywords AS ProductKeywords,Industry.parentid AS IndustryParentid,Industry.name AS IndustryName"; var $product_sorts = array(1=>"最新产品",2=>"普通商品",3=>"库存商品"); var $check_status = array(0=>"等待审核",1=>"有效信息",2=>"审核不通过",3=>"无效"); function Products() { $this->setTableName($GLOBALS['tb_prefix'].$this->table_name); } function checkProducts($id = null, $status = null) { if(is_array($id)){ $checkId = "id in (".implode(",",$id).")"; }else { $checkId = "id=".$id; } $sql = "UPDATE ".$this->getTable()." SET status=".$status." WHERE ".$checkId; $return = $GLOBALS['g_db']->Execute($sql); if($return){ return true; }else { return false; } }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -